title: ASP.Net MVC3 Parent Child Model Binding
body: <p>I have a partial template that uses a User object as a model. The user has a collection of Accounts. On this partial template I have a loop as follows. The _Account partial template is bound to the Account class </p>
  
  <pre><code>  @foreach (var item in Model.Accounts)
              { 
                  &lt;tr&gt;
                      &lt;td colspan="6"&gt;
                          &lt;div&gt;
                              @Html.Partial("_Account", item)
                          &lt;/div&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
              }
  </code></pre>
  
  <p>In my controller method I initially tried </p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
  public ActionResult UserDetails(User user, string actionType)
  </code></pre>
  
  <p>But the User.Accounts collection is empty. Then I tried this. Still the Accounts collection is empty.</p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
  public ActionResult UserDetails(User user,  
                               [Bind(Prefix="User.Accounts")]
                               FixupCollection&lt;Account&gt; Accounts, 
                               string actionType)
  </code></pre>
  
  <p>Can I use the default Modelbinder implementation to achieve this or do I need to do anything different?</p>