title: MVC UpdateModel ComplexType
body: <p>If you have the following type.</p>
  
  <pre><code>public class Person
  {
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public List&lt;TheParameters&gt; Parameters { get; set; }
      public Address Address { get; set; }
  }
  public class Address
  {
      public string Street { get; set; }
      public string City { get; set; }
      public string State { get; set; }
  }
  public class TheParameters
  {
      public string Parameter { get; set; }
  }
  </code></pre>
  
  <p>You make your page stronglytyped to Person.</p>
  
  <pre><code>"System.Web.Mvc.ViewPage&lt;Person&gt;"
  
  &lt;form action="/Home/Save" method="post"&gt;  
  
      &lt;b&gt;Your Name&lt;/b&gt; 
      &lt;label for="FirstName"&gt;  
          &lt;span&gt;First Name&lt;/span&gt;  
          &lt;%=Html.TextBox("Person.FirstName", ViewData.Model.FirstName) %&gt;  
      &lt;/label&gt;  
  
      &lt;label for="LastName"&gt;  
          &lt;span&gt;Last Name&lt;/span&gt;  
          &lt;%=Html.TextBox("Person.LastName", ViewData.Model.LastName)%&gt;  
      &lt;/label&gt;  
  
      &lt;b&gt;Your Address&lt;/b&gt;  
  
      &lt;label for="Street"&gt;  
          &lt;span&gt;Street&lt;/span&gt;  
          &lt;%=Html.TextBox("Person.Address.Street", ViewData.Model.Address.Street)%&gt;  
      &lt;/label&gt;  
  
      &lt;label for="City"&gt;  
          &lt;span&gt;City&lt;/span&gt;  
          &lt;%=Html.TextBox("Person.Address.City", ViewData.Model.Address.City)%&gt;  
      &lt;/label&gt;  
  
      &lt;label for="State"&gt;  
          &lt;span&gt;State&lt;/span&gt;  
          &lt;%=Html.TextBox("Person.Address.State", ViewData.Model.Address.State)%&gt;  
      &lt;/label&gt;  
  
      &lt;label for="Parameters"&gt;
          &lt;span&gt;Parameters&lt;/span&gt;
          &lt;%
              int index = 0;
              foreach (TheParameters parameter in ViewData.Model.Parameters)
              {
                  Response.Write(Html.TextBox("Person.Parameters.Parameter[" + index + "]", parameter.Parameter));
                  index++;
              }
           %&gt;
      &lt;/label&gt;
  
      &lt;input id="submit" type="submit" value="submit" /&gt;  
  
  &lt;/form&gt; 
  </code></pre>
  
  <p></p>
  
  <p>In the controller the following:</p>
  
  <pre><code>    public ActionResult Index()
      {
          Person p = new Person();
          p.FirstName = "Name";
          p.LastName = "Last";
          p.Address = new Address();
          p.Address.City = "city";
          p.Address.State = "state";
          p.Address.Street = "street";
  
          p.Parameters = new List&lt;TheParameters&gt;();
          p.Parameters.Add(new TheParameters(){ Parameter = "P1" });
          p.Parameters.Add(new TheParameters(){ Parameter = "p2" });
  
          ViewData.Model = p;
  
          return View();
      }
  
      public ActionResult Save(FormCollection form)   
      {
          Person p = new Person();
  
  
          UpdateModel(p, "Person", form.ToValueProvider());
  
          return RedirectToAction("Index");
  
      }
  </code></pre>
  
  <p>I call the UpdateModel. All properties are filled in properly except for the Person.Parameters. This is always null after the updateModel.</p>
  
  <p>Is there a solution for this or a workaround?</p>
  
  <p>regards,
  Steve</p>