title: How to pass model to partial view
body: <p>I have two view models:</p>
  
  <pre><code>public class ParentViewModel
      {
          public Id { get; set; }
          .....
          public ChildViewModel Child{ get; set; }
      }
  
  public class ChildViewModel
      {
          public ChildId { get; set; }
          .....
      }
  </code></pre>
  
  <p>Controllers:</p>
  
  <pre><code>    public ActionResult Index()
          {
              .... &lt;some code&gt;
              return View("NewIndex", ParentViewModel);
          }
  
      [HttpPost]
      public ActionResult PartialAction(ChildViewModel childView)
      {
          return RedirectToAction("Index");
      }
  </code></pre>
  
  <p>And views:
  Index</p>
  
  <pre><code>@model ParentViewModel
  ....
  @Html.Partial("_Partial", Model.Child)
  </code></pre>
  
  <p>and _Partial</p>
  
  <pre><code>@model ChildViewModel
  ... do some stuff with child model
  </code></pre>
  
  <p>When I'm trying to open Index page I've got an error:</p>
  
  <p>The model item passed into the dictionary is of type 'ParentViewModel', but this dictionary requires a model item of type 'ChildViewModel'.</p>
  
  <p>Why it tries to pass ParentViewModel instead of ChildViewModel. What I'm doing wrong?</p>