title: Persisting Selected Value in MVC DropDownLists
body: <p>I'm new to MVC, but I've been all over this, read all the documentation and all the questions and all the blog posts I can find, and all I'm doing is getting completely wrapped around the axle.</p>
  
  <p>I'm trying to make a "create" Action and View. My data entry is relatively straight forward, and common: I have a drop down list and a text box.  In my case, I'm creating a user contact channel, and the drop down box chooses between email and textmsg, and the text box then enters the relevant contact information, either a well formed email address, or a mobile phone number.</p>
  
  <p>Here's a (slightly simplified form of)  my View page:</p>
  
  <pre><code> &lt;tr&gt;
       &lt;td&gt;&lt;%= Html.DropDownList("ChannelDescription", Model.ChannelDescription, "Select a Channel", new { id = "ChannelDDL", onchange="ChannelDDLChanged()" })%&gt;
           &lt;br /&gt;
           &lt;%= Html.ValidationMessage("ChannelDescription", "Please Select a Channel") %&gt;
        &lt;/td&gt;
        &lt;td&gt;
             &lt;%= Html.TextBox("SubscriberNotificationAddr") %&gt; &lt;br /&gt;
             &lt;%= Html.ValidationMessage("SubscriberNotificationAddr", "Please enter a contact address or number") %&gt;
         &lt;/td&gt;
    &lt;/tr&gt;
  </code></pre>
  
  <p>I'm using a strongly typed ViewData model, rather than using the ViewDataDictionary. The ChannelDescription element is a SelectList, which is initialized with the list of choices and no selection. </p>
  
  <p>The initial display of the form, the data entry into the form, and the extraction of the data from the form by the controller goes fine.</p>
  
  <p>My problem is if the data contains an error, such as a mal-formed email address or cell phone number, and I have to return to the view, I have not been successful in getting the drop down list selection redisplayed. The ChannelDescription element is recreated in the controller with the user's choice as the selected item. I have set breakpoints on that line of the View, and verified that the selected element of the list of items has the Selected property set to true, but it still displays the default "Select a Channel".</p>
  
  <p>This seems like it would be a very common situation, and shouldn't be this hard.  What am I doing wrong?</p>
  
  <p>FYI, this is with MVC 1.0 (Release), Windows 7, and VS 2008, running under Firefox 3.5.2.</p>