1 min read

asp-page not working with RazorPages in .NET Core

asp-page not working with RazorPages in .NET Core

I had a problem where my Razor Pages were rendering the "asp-page" Helper to the output HTML. It was happening with pages in an Area. It turns out that you need to copy _ViewImports.cshtml from the Pages folder to the root Area folder.