title: MVC4: nested partial-view loses model data
body: <p>In an MVC4 project im using a partial View thats using a ViewModel and has a GET Form on it. In the Controller action i expect the ViewModel object with some data. 
  When this partial is placed on a normal (.cshtml) View, i recieve the data via the expected ViewModel object in the Controller action. But, When this partial is placed on <strong><em>another partial view</em></strong>, for some reason the ViewModel object in the controller action is empty. When i step through the creation of the HttpGet-form, the passed-in model is not empty, but when the GET controller action is called, the model is.</p>
  
  <p>Anyone know the reason for this? Is this some MVC behavior i don't know about maybe? Thanks!</p>
  
  <p><strong>The Partial:</strong></p>
  
  <pre><code>@model ViewModel
      @if (Model != null)
      {
          using (Html.BeginForm("DoSomething", "Home", FormMethod.Get))
          { 
              @Html.HiddenFor(m =&gt; m.Object)            
              &lt;input id="btnSend" type="submit"&gt; 
          }
      }
  </code></pre>
  
  <p><strong>The Other Partial:</strong></p>
  
  <pre><code>@using OtherViewModel.ViewModel
  @Html.Partial("The Partial", Model.ViewModel, ViewData)
  </code></pre>
  
  <p><strong>The View:</strong></p>
  
  <pre><code>@Html.Partial("_TheOtherPartial", Model.OtherViewModel, new ViewDataDictionary(ViewData) {
                  TemplateInfo = new System.Web.Mvc.TemplateInfo { HtmlFieldPrefix = "prefix" }
      })
  </code></pre>
  
  <p><strong>The Controller</strong></p>
  
  <pre><code>[HttpGet]
  [AllowAnonymous]
  public ActionResult DoSomething(ViewModel data)
  {
  }
  </code></pre>