title: RenderPartial using inside PartialView in MVC3 ASP.NET
body: <p>I am thoroughly confused about how this works:</p>
  
  <p>I have a partial view that is rendered by the controller.  This partial view is rendered via Ajax call and is served by an ActionResult of a controller.  Partial View is strongly typed and is rendered with a model via </p>
  
  <pre><code>return this.PartialView("OuterPartialView", modelObject).
  </code></pre>
  
  <p>Inside this partial view, I am rendering another partial view, also strongly typed and bound to the same model, via the <code>@{ Html.RenderPartial("HiddenVariablesView", Model); }</code> call that renders a small section of Hidden variables (I use HiddenFor to inject them into the form).</p>
  
  <p><strong>Issue is</strong>: the hidden input variables are rendered in the HTML as empty/default values of the model - as if the model that was passed was simply created via default constructor.  What's even more strange, is that when I put a breakpoint inside the partial view generation ("HiddenVariablesView" as well as "OuterPartialView") I can see that my Model object is correctly populated.</p>
  
  <p>Would appreciate any advice</p>
  
  <p><strong>EDIT:</strong> The "OuterPartialView" has a form that submits back to itself (via ajax) and basically replaces itself with a new version of itself inside a div.  It appears that the model for the partial view is reverting back to the model that was originally created when the OuterPartialView was constructed via GET method of the action controller.  Any POST methods of the controller are called during the submits, but the changes to model that are done inside the controller are not reflecting in the generated HTML</p>