title: How to set default selected value for Html.DropDownListFor
body: <pre><code>    @if (HttpContext.Current.Request.Cookies[MyCookies.SelectedRegion] != null)
       {
         var defaultRegionValue = HttpContext.Current.Request.Cookies[MyCookies.SelectedRegion].Value;
          @Html.DropDownListFor(m =&gt; m.SelectedRionName, Model.RegionList, defaultRegionValue)
       }
       else
       {
         @Html.DropDownListFor(m =&gt; m.SelectedRionName, Model.RegionList, "Select")
       }
  </code></pre>
  
  <p>I have the above sample in my view which is supposed to populate a Dropdownlist with a list of regions. Once a region is selected, i set that region as their default region in a cookie. </p>
  
  <p>The next time they visit the application, i'm retrieving the cookie value such that i can pre-select a region (in the dropdown) which matches my cookie value in variable "<strong>defaultRegionValue</strong>". </p>
  
  <p>The problem with my code above is that "<strong><em>defaultRegionValue</em></strong>"  is coming in the dropdownlist as the DataTextField yet i want it as the DataTextValue. </p>
  
  <p>I don't want to display the real string value in variable "defaultRegionValue", instead i want the dropdownlist to read it as selectedValue but then display i'ts corresponding text value. </p>
  
  <p>At the moment is the displayed value and the selected value is null. How do i set this up correctly?   </p>
  
  <p><strong>And below is my RegionList definition</strong></p>
  
  <pre><code> public SelectList RegionList
      {
          get
          {
              Dictionary&lt;string, string&gt; items = this.qryRegionList.ToDictionary(k =&gt; k.RegionName, v =&gt; v.RegionID);
              return new SelectList(items.OrderBy(k =&gt; k.Key), myConstants.Value, myConstants.Key);
          }
      }
  </code></pre>