Home > Back-end >  No webpage was found for the web address: http://localhost:XXX/login in ASP. NET CORE 6 Web App
No webpage was found for the web address: http://localhost:XXX/login in ASP. NET CORE 6 Web App

Time:11-13

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 ></span> Login</a></li>

CodePudding user response:

Check if your Controller Name in the layout.cshtml page is the same Name as your build Controller. P.S Could you be more elaborate with your Code in your layout file and the login Controller.

CodePudding user response:

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">
  • Related