title: MVC4 binding drop down list in a list (bug)
body: <p><em>I have the below code in a view. (index.cshtml)</em>  </p>
  
  <p><strong>Binding Problem</strong>  </p>
  
  <ul>
  <li>The first drop down selects the correct value, based on the 'ChildItem' editor template.</li>
  <li>The second example using an inline drop down list <em>does not work</em> I don't want to create an editor template just to display drop down values.</li>
  <li>The odd thing is that TextBoxFor will show the correct value. This seems to be an issue just with the drop down list.  </li>
  </ul>
  
  <p>How do I fix the binding so that the second drop down works? I debugged it. It would appear that ViewData.Eval is not picking up the correct value from <code>_.Children[i].ChooseId</code>.</p>
  
  <p><strong>Update (bug)</strong><br>
  <em>This is a confirmed bug (low priority, how?) in the MVC framework <a href="http://aspnet.codeplex.com/workitem/8311" rel="nofollow noreferrer">http://aspnet.codeplex.com/workitem/8311</a></em></p>
  
  <pre><code>@using (Html.BeginForm())
  {
      for (int i = 0; i &lt; Model.Children.Count(); i++)
      {
         &lt;p&gt;A: @Html.EditorFor(_ =&gt; _.Children[i], "ChildItem")&lt;/p&gt;
         &lt;p&gt;B: @Html.DropDownListFor(_ =&gt; _.Children[i].ChooseId, TestModel.PeopleSelect)&lt;/p&gt;
      }
      &lt;button type="submit"&gt;GO&lt;/button&gt;
  }
  </code></pre>
  
  <p>I have tried using <code>DropDownListFor(_ =&gt; Model.Children[i].ChooseId)</code>, same result.<br>
  using <code>TextBoxFor(_ =&gt; _.Children[i].ChooseId)</code> shows the correct value, <strong>wierd?</strong></p>
  
  <p>For reference here is <code>ChildItem.cshtml</code></p>
  
  <pre><code>@using dropdown.Controllers
  @using dropdown.Models
  @model dropdown.Models.TestPerson
  @Html.DropDownListFor(_ =&gt; _.ChooseId, TestModel.PeopleSelect)
  </code></pre>
  
  <p>It looks like this:</p>
  
  <p><img src="https://i.stack.imgur.com/2WyNw.jpg" alt="A works, B does not."></p>