title: Complex models and partial views - model binding issue in ASP.NET MVC 3
body: <p>I have 2 models in my sample MVC 3 application, <code>SimpleModel</code> and <code>ComplexModel</code>, shown below:</p>
  
  <pre><code>public class SimpleModel
  {
      public string Status { get; set; }
  }
  
  public class ComplexModel
  {
      public ComplexModel()
      {
          Simple = new SimpleModel();
      }
  
      public SimpleModel Simple{ get; set; }
  }
  </code></pre>
  
  <p>I have defined views for this models: </p>
  
  <p><code>_SimplePartial.cshtml</code>:</p>
  
  <pre><code>@model SimpleModel
  
  @Html.LabelFor(model =&gt; model.Status)
  @Html.EditorFor(model =&gt; model.Status)
  </code></pre>
  
  <p>and <code>Complex.cshtml</code>:</p>
  
  <pre><code>@model ComplexModel
  
  @using (Html.BeginForm()) {
  
      @Html.Partial("_SimplePartial", Model.Simple)
      &lt;input type="submit" value="Save" /&gt;
  }
  </code></pre>
  
  <p>After submitting form, with random value entered in <code>Status</code> field, the value is not binded to my model. The <code>Status</code> field is <code>NULL</code> when I'm checking the model in my controller action:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Complex(ComplexModel model)
  {
      // model.Simple.Status is NULL, why ?
  }
  </code></pre>
  
  <p>Why is it not binded ? I don't want to inherit models. Do I have to write my custom model binders for such simple case ?</p>
  
  <p>Regards.</p>