0

I have created a web app using razor pages in ASP.NET Core 6 and I am reaching a problem when it comes to adding a new razor pages link into the _Layout.cshtml. Every time I try to test the website and press the link to new page I added, it does not send me to that page.

I have looked into the razor pages properties and matched the Build property with Content hoping that was the reason why it was not working but I was unsuccessful.

I have also tried adding to the page link so that it can clearly find it, but it did not work.

 <li><a asp-page="Pages/Login"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>

1 Answers1

0

The value that you pass to the asp-page attribute is the relative path to the page rooted in the Pages folder, which means that you should not include "Pages" as part of the value:

<a asp-page="/Login">
Mike Brind
  • 28,238
  • 6
  • 56
  • 88