Asp.net core razor pages load partial page
I use asp.net core 2 new feature Razor pages. in the _layout.cshtml. <body> <div> @await Html.PartialAsync("_LayoutHeader") <div class="row"> <div> <div class="row"> @RenderBody() </div> </div> </div> the _layoutHeader.cshtml is page with code behind. @page @using Microsoft.AspNetCore.Identity @model Yiko.Ent.WebRazorPages.Pages._LayoutHeaderModel and @RenderBody will load index.cshtml with pagemodel. @page @model Yiko.Ent.WebRazorPages.Pages.Home.IndexModel @{ ViewData["Title"] = "Home"; } run the project. throw a error: InvalidOperationException: The model item passed into the