Razor Pages - Overview
Razor pages provides a way to build web applications using a page-focused approach. Under the hood, it uses the same routing and middleware as MVC, and it provides directory-based conventions for views. Pages can have a viewmodel where we can define page data and actions. Pages: Pages are the main part of a Razor Pages application. Pages are created in the Pages directory and are named with the .cshtml extension. Each page can have a corresponding .cshtml.cs file which contains the page model. Page Model: The page model is responsible for handling requests and rendering the page. It is a class that contains the data and actions for the page. The page model is defined in a .cshtml.cs file and is associated with a .cshtml file. Getting Started Create a new project using the dotnet command-line interface. ...