title: Losing partial view model form values
body: <p>I have a form (using the primary viewmodel) and then a partial view to implement the address portion of the form (secondary viewmodel). When I submit the form, I'm not getting back the values of the inner, partial view part of the form. Not getting any errors, just losing the values of the partial. Code as follows:</p>
  
  <p>"Main" portion of form:</p>
  
  <pre><code>@model REMS.ViewModels.AddComplexViewModel
  
  @{
      ViewBag.Title = "Add Complex";
  }
  
  &lt;h2&gt;@ViewBag.Title&lt;/h2&gt;
  
  @{ Html.Partial("~/Views/Shared/Partials/ActionStatusPartial.cshtml", Model.ActionStatusMessageViewModel); }
  
  @using (Html.BeginForm("AddComplex", "Admin", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
  {
      @Html.AntiForgeryToken()
      &lt;h4&gt;Add a New Complex&lt;/h4&gt;
      &lt;hr /&gt;    
      &lt;div class="form-group"&gt;
          @Html.LabelFor(m =&gt; m.Name, new { @class = "col-md-2 control-label" })
          &lt;div class="col-md-10"&gt;
              @Html.TextBoxFor(m =&gt; m.Name, new { @class = "form-control" })
          &lt;/div&gt;
      &lt;/div&gt;
  
      @Html.Partial("~/Views/Shared/Partials/AddressFormPartial.cshtml", Model.AddressViewModel)
  
      &lt;div class="form-group"&gt;
          @Html.Label("Owner", new { @class = "col-md-2 control-label" })
          &lt;div class="col-md-10"&gt;
              @Html.DropDownList("SelectedOwner", Model.Owners, "Select an Owner...")
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="form-group"&gt;
          &lt;div class="col-md-offset-2 col-md-10"&gt;
              &lt;input type="submit" class="btn btn-default" value="Add" /&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>Partial view of form:</p>
  
  <pre><code>@model REMS.ViewModels.AddressViewModel
  
  &lt;div class="form-group"&gt;
  @Html.LabelFor(m =&gt; m.Address1, new { @class = "col-md-2 control-label" })
  &lt;div class="col-md-10"&gt;
      @Html.TextBoxFor(m =&gt; m.Address1, new { @class = "form-control" })
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      @Html.LabelFor(m =&gt; m.Address2, new { @class = "col-md-2 control-label" })
      &lt;div class="col-md-10"&gt;
          @Html.TextBoxFor(m =&gt; m.Address2, new { @class = "form-control" })
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      @Html.LabelFor(m =&gt; m.City, new { @class = "col-md-2 control-label" })
      &lt;div class="col-md-10"&gt;
          @Html.TextBoxFor(m =&gt; m.City, new { @class = "form-control" })
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      @Html.LabelFor(m =&gt; m.State, new { @class = "col-md-2 control-label" })
      &lt;div class="col-md-10"&gt;
          @Html.TextBoxFor(m =&gt; m.State, new { @class = "form-control" })
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      @Html.LabelFor(m =&gt; m.Zip, new { @class = "col-md-2 control-label" })
      &lt;div class="col-md-10"&gt;
          @Html.TextBoxFor(m =&gt; m.Zip, new { @class = "form-control" })
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>View Models:</p>
  
  <pre><code>public class AddComplexViewModel
  {
      [Display(Name = "Name")]
      public string Name { get; set; }
  
      [Display(Name = "AddressViewModel")]
      public AddressViewModel AddressViewModel { get; set; }
  
      [Display(Name = "SelectedOwner")]
      public Guid SelectedOwner { get; set; }
  
      [Display(Name = "Owners")]
      public SelectList Owners { get; set; }
  
      [Display(Name = "ActionStatusMessageViewModel")]
      public ActionStatusViewModel ActionStatusMessageViewModel { get; set; }
  
      public AddComplexViewModel()
      {
          ActionStatusMessageViewModel = new ActionStatusViewModel();
          AddressViewModel = new AddressViewModel();
      }
  }
  
  
  public class AddressViewModel
  {
      public string Address1 { get; set; }
      public string Address2 { get; set; }
      public string City { get; set; }
      public string State { get; set; }
      public string Zip { get; set; }
  }
  </code></pre>
  
  <p>When I submit the form the address values are all null. Am I missing something?</p>