title: model item passed into the ViewDataDictionary is of type 'MainModel', but this ViewDataDictionary instance requires a model item of type 'testModel'
body: <p>Any help will be appreciate!
  I keep pages almost empty to first resolve this issue.
  Tried different way in layout page to call partial view.
  using asp.net core 2.1</p>
  
  <p>My partial view for sure should load earlier than the main page. Now its empty, but it will contain some data to load.</p>
  
  <p>This is my layout with single call to partial view:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  @await Html.PartialAsync("~/Pages/PartialPages/test.cshtml");
                  @*&lt;partial name="~/Pages/PartialPages/test.cshtml" /&gt;*@
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  
      &lt;div class="content"&gt;
      &lt;div style="float: left; margin-left: 1%; width: 100%"&gt;
          @RenderBody()
      &lt;/div&gt;
      &lt;/div&gt;
  
      @RenderSection("Scripts", required: false)
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I have empty "Main" page</p>
  
  <pre><code>public class MainModel : PageModel
      {
          public void OnGet()
          {
  
          }
      }
  
  @page
  @model APWeb.Pages.MainModel
  @{
      ViewData["Title"] = "Main";
  }
  
  &lt;h2&gt;Main&lt;/h2&gt;
  </code></pre>
  
  <p>This is my partial view page:</p>
  
  <pre><code>public class testModel : PageModel
      {
          public void OnGet()
          {
  
          }
      }
  
  @page
  @model APWeb.Pages.PartialPages.testModel
  @*
      For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
  *@
  </code></pre>
  
  <p>My main page use layout page.<a href="https://i.stack.imgur.com/pJG5o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pJG5o.png" alt="enter image description here"></a></p>