title: How to bind nested array element property value to TextBox in ASP.NET MVC
body: <p>I have model</p>
  
  <pre><code>public class User 
  {
      public User()
      {
         Addreses = new List&lt;Address&gt;();
      }
      public String Name { get; set; }
      public String LastName { get; set; }
      public List&lt;Address&gt; Addresses { get; private set; }
  }
  
  public class Address
  {
      public String Street { get; set; }
      public String City { get; set; }
  }
  </code></pre>
  
  <p>And I want do display user addresses as ul list. I do this in view page</p>
  
  <pre><code>    using (Html.BeginForm("UpdateUser", "Home", FormMethod.Post))
      {
  %&gt;
  &lt;% =Html.TextBox("user.Name")%&gt;&lt;br /&gt;
  &lt;% =Html.TextBox("user.LastName")%&gt;&lt;br /&gt;
  &lt;ul&gt;
      &lt;% 
         for (Int32 index = 0; index &lt; ((User)ViewData["user"]).Addresses.Count; index++)
         {%&gt;
      &lt;li&gt;
          &lt;% =Html.TextBox("user.Addresses[" + index + "].Street")%&gt;,
          &lt;% =Html.TextBox("user.Addresses[" + index + "].PostalCode")%&gt;,
          &lt;% =Html.TextBox("user.Addresses[" + index + "].City")%&gt;
      &lt;/li&gt;
      &lt;% 
         }
      %&gt;
  &lt;/ul&gt;
  &lt;input type="submit" value="Submit" /&gt;
  &lt;% }%&gt;
  </code></pre>
  
  <p>And data in textboxes populated in for statement are empty. Ofcourse I could add next parameter TextBox method to assign value, but two textboxes upper (for instance "user.Name") correctly read/set value. </p>
  
  <p>What I'm doing wrong?</p>
  
  <p>PS. I'm using MVC RTM 1.0</p>