ASP.NET Core
Neil Haddley • March 21, 2023
Create Razor Pages with ASP.NET Core.
ASP.NET Core is a cross-platform framework for building Internet-connected apps.
Razor Pages is the preferred way to create page or form-based apps in ASP.NET Core. From the docs, "Razor Pages can make coding page-focused scenarios easier and more productive than using controllers and views."
I used Visual Studio 2022 and ASP.NET Core to create a todo app.
Page and PageModel
Razor pages include HTML markup and are similar to MVC views.
Razor PageModel classes are combination of MVC controllers and models.
The OnGet() method below is executed when a browser sends a GET request to the server.
An OnPost() method is executed when a browser sends a POST request to the server.


























