title: ASP.NET MVC Subform data not posting
body: <p>This seems simple enough but I am missing something:</p>
  
  <p>Model:</p>
  
  <pre><code>public class MainModel
  {
  
     public SubModel oSubmodel = new Submodel();
  
  ....
  
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@model myApp.Models.MainModel
  @using (Html.BeginForm("Index","Account", FormMethod.Post, new { id = "form"}) 
  {
  
       @Html.LabelFor(m =&gt; m.oSubmodel.prop1
  
       @Html.TextBoxFor(m =&gt; m.oSubmodel.prop1
  
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code> [HttpPost]
   public ActionResult Index(MainModel oModel)
   {
        ....
        string prop = oModel.prop &lt;-----------ok
        string prop1 = oModel.oSubmodel.prop1   &lt;----------null
    }
  </code></pre>
  
  <p>The m.oSubmodel.prop1 data is display correctly in the view. When the data is posted back to the controller MainModel values are passed correctly, however - all submodel values are null.</p>
  
  <p>Anybody give any insight?</p>