title: MVC Parent Child actions page rendering?
body: <p>I am learning to embed a child action inside a parent action, and render the whole page properly when a form is submitted from the child action.</p>
  
  <p>ParentAction.cshtml--------------------------------------</p>
  
  <pre><code>@model Web1.Models.ParentActionModel
  @{ViewBag.Title = "ParentAction";}
  &lt;h2&gt;Parent Action&lt;/h2&gt;
  @Html.ValidationSummary(true, "Please correct parent errors and try again.")
  @using (Html.BeginForm()) {
    //parent forminput  stuff
    &lt;input type="submit" value="Parent Button" /&gt;
  }
  @Html.Action("ChildAction","Home") &lt;!-- ChildAction is included here --&gt;
  </code></pre>
  
  <p>ChildAction.cshtml (included in parent.cshtml) ------------</p>
  
  <pre><code>@model Web1.Models.ChildActionModel
  @{ViewBag.Title = "ChildAction";}
  &lt;h2&gt;Child Action&lt;/h2&gt;    
  @Html.ValidationSummary(true, "Please correct child errors and try again.")
  @using (Html.BeginForm("ChildAction", "Home")) {
      //child form input stuff
      &lt;input type="submit" value="Child Button" /&gt;
  }
  </code></pre>
  
  <p>HomeController.cs-----------------------</p>
  
  <pre><code>public ActionResult ParentAction() {
      return View();
  }
  [HttpPost]
  public ActionResult ParentAction(ParentActionModel pmodel) {
      //do model update stuff
      return View(pmodel);
  }
  [ChildActionOnly]
  public ActionResult ChildAction() {
      return PartialView();
  }
  [HttpPost]
  public ActionResult ChildAction(ChildActionModel cmodel) {
      //do model update stuff
      return PartialView(cmodel); // &lt;---This is wrong, What's the correct way to do it?
  }
  </code></pre>
  
  <p>Now, when I click the "Child Button", I will only get the view of the child action (durrr!), how do I fix it to generate full page parent+children view? It seems like a logic easy enough, but I am stuck on it for hours. </p>