title: MVC DropDownListFor Null Values
body: <p>I am having problems using the dropdownlistfor htmlhelper in MVC. When post back occurs there  is nothing selected and the values in the model for the list, and the selected item are null.</p>
  
  <p>Here are my Models:</p>
  
  <pre><code>namespace MvcTestWebApp.Models
  {
      public class Customer
      {
          public string name { get; set; }
  
          public List&lt;SelectListItem&gt; members { get; set; }
  
          public Member selected { get; set; }
      }
  
      public class Member
      {
          public string name { get; set; }
  
      }
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>namespace MvcTestWebApp.Models
  {
      public class CustomerController : Controller
      {
          //
          // GET: /Customer/
          public ActionResult Index()
          {
              Customer cust = new Customer() { name = "Cust1" };
              cust.members = new List&lt;SelectListItem&gt;();
  
              cust.members.Add(new SelectListItem(){Text = "Bob"} );
              cust.members.Add(new SelectListItem(){Text = "Dave"} );
  
              return View(cust);
          }
  
          [HttpPost]
          public ActionResult Index(Customer customer)
          {
  
             return View();
          }
  
  
      }
  }
  </code></pre>
  
  <p>And View:</p>
  
  <pre><code>    @model MvcTestWebApp.Models.Customer
  
  @{
      ViewBag.Title = "Customer";
      Layout = null;
  }
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt; Index &lt;/title&gt;
  &lt;/head&gt;
  
      &lt;body&gt;
  
  
  @using (Html.BeginForm()) {
      @Html.ValidationSummary(true)
  
      &lt;fieldset&gt;
          &lt;legend&gt;Customer Data&lt;/legend&gt;
  
            @Html.HiddenFor(model =&gt; model.name)
  
            @Html.DropDownListFor(model =&gt; model.selected, Model.members, "--Select--")
  
          &lt;p&gt;
              &lt;input type="submit" value="Save" /&gt;
          &lt;/p&gt;
  
          &lt;/fieldset&gt; 
  }
  
      &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>When I select something from the select list and click the submit button nulls are returned:</p>
  
  <p><img src="https://i.stack.imgur.com/HUd1c.png" alt="nullselect"></p>
  
  <p>Can anyone shed some light on what I'm doing wrong?</p>