ASP.NET Razor Pages is a new web framework for building dynamic pages using templates, partials, and code-behind files. Razor Pages has been built from the ground up with a singular focus on creating simple yet powerful web pages. There’s no view engine to decide between server-side or client-side templating, so you have the option to write your markup in whatever way works best for you and your application.
Adding a new page
When it comes to adding new pages and content to an existing project using Visual Studio is a process that allows us to scale our application easily without breaking existing code.
To add a new page to an existing project, Open the project using Visual Studio 2019 and right click on the Pages folder.
From the menu, Click on Add
Click on Razor Page…
From the Add new item window you have the option to select what kind of Razor page you like. In our case we select an Empty page.
Adding the Page to the Header menu
To add the page to the header menu, open the _layout.cshtml page located under the Shared folder and add it to the list of pages.
The easiest way to do it is to copy existing page and change the name and link.
Leave a Reply