title: Problem with different model type in partial view
body: <p>I have one (razor) page that contain 5 different partial views. Each partial view is responsible for some data from database. In that master page I use one model object but for partial views I use different model objects. The problem is that when I set model object in partial view my application breaks with following error:
  The model item passed into the dictionary is of type <code>'MyProject.WebUI.Models.BigPageViewModel', but this dictionary requires a model item of type 'MyProject.WebUI.Models.StatisticsViewModel'.</code></p>
  
  <p>Here is the code:
  This is the big page that contains partial views:</p>
  
  <pre><code>@model MyProject.WebUI.Models.BigPageViewModel
  @{
      Layout = "../Shared/_BigPage.cshtml";
  }
  ...
  @{Html.RenderPartial("../Data/StatisticsFeed");}
  ...
  </code></pre>
  
  <p>This is controller code. For this method I created partial view that should be rendered in big page.</p>
  
  <pre><code>public ActionResult StatisticsFeed()
          {
              StatisticsViewModel cs = new StatisticsViewModel();
              cs.TotalData = (new StatisticsRepository()).GetStatisticCompleteData(1);
              return View(cs);
          }
  </code></pre>
  
  <p>And this is the code in partial view:</p>
  
  <pre><code>@model MyProject.WebUI.Models.StatisticsViewModel
  ...
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/RZ4Df.png" alt="enter image description here"></p>
  
  <p>I used 'RenderAction' method instead of 'RenderPartial' and it return value but returns me two results one with data and one without, this must be some stupid mistake...</p>
  
  <pre><code>public ActionResult StatisticsFeed()
          {
            StatisticsViewModel cs = new StatisticsViewModel();
                  cs.TotalData = (new StatisticsRepository()).GetStatisticCompleteData(1);
  
              cs.TotalCitizns = 569;
              return View(cs);
          }
  </code></pre>