title: Why is ListBoxFor not selecting items, but ListBox is?
body: <p>I have the following code in my view:</p>
  
  <pre><code>&lt;%= Html.ListBoxFor(c =&gt; c.Project.Categories,
          new MultiSelectList(Model.Categories, "Id", "Name", new List&lt;int&gt; { 1, 2 }))%&gt;
  
  &lt;%= Html.ListBox("MultiSelectList", 
          new MultiSelectList(Model.Categories, "Id", "Name", new List&lt;int&gt; { 1, 2 }))%&gt;
  </code></pre>
  
  <p>The only difference is that the first helper is strongly typed (ListBoxFor), and <strong>it fails to show the selected items</strong> (1,2), even though the items appear in the list, etc. The simpler ListBox is working as expected.</p>
  
  <p>I'm obviously missing something here. I can use the second approach, but this is really bugging me and I'd like to figure it out.</p>
  
  <p>For reference, my model is:</p>
  
  <pre><code>public class ProjectEditModel
  {
      public Project Project { get; set; }
      public IEnumerable&lt;Project&gt; Projects { get; set; }
      public IEnumerable&lt;Client&gt; Clients { get; set; }
      public IEnumerable&lt;Category&gt; Categories { get; set; }
      public IEnumerable&lt;Tag&gt; Tags { get; set; }
      public ProjectSlide SelectedSlide { get; set; }
  }
  </code></pre>
  
  <h2>Update</h2>
  
  <p>I just changed the ListBox name to Project.Categories (matching my model) and it now FAILS to select the item.</p>
  
  <pre><code>&lt;%= Html.ListBox("Project.Categories",
          new MultiSelectList(Model.Categories, "Id", "Name", new List&lt;int&gt; { 1, 2 }))%&gt;
  </code></pre>
  
  <p>I'm obviously not understanding the magic that is happening here.</p>
  
  <h2>Update 2</h2>
  
  <p>Ok, this is purely naming, for example, this works...</p>
  
  <pre><code>&lt;%= Html.ListBox("Project_Tags",
  new MultiSelectList(Model.Tags, "Id", "Name", Model.Project.Tags.Select(t =&gt; t.Id)))%&gt;
  </code></pre>
  
  <p>...because the field name is Project_Tags, not Project.Tags, in fact, anything other than Tags or Project.Tags will work. I don't get why this would cause a problem (other than that it matches the entity name), and I'm not good enough at this to be able to dig in and find out.</p>