Razor Pages
Razor Pages is an ASP.NET Core page-focused programming model in which independently addressable pages combine Razor markup with request-handling logic.
ASP.NET Core in Action, 3e
A Razor Page is an independently addressable ASP.NET Core page endpoint typically composed of a .cshtml view file and an associated PageModel class.
- How it is used
- Builds page-based server-rendered applications that handle URLs and form submissions and generate HTML.
- How deep it goes
- Explains setup, page handlers, request binding, and routing conventions, including ways to customize routes.
- Examples
- Uses template Home and Privacy pages and a category-filtered to-do list to illustrate views and handlers.
- What you can do after
- Apply it via ASP.NET Core to configure page endpoints, handle requests, and render server-side HTML.
Pro ASP.NET Core 7, Tenth Edition
A Razor Page is an ASP.NET Core page artifact that combines Razor markup with page-specific request-handling code.
- How it is used
- Uses page-focused markup and handlers to generate HTML for self-contained features alongside MVC controllers.
- How deep it goes
- Works through configuration, routing, page models, handlers, layouts, and CRUD; defers detailed form and antiforgery mechanics.
- Examples
- Builds a shopping cart, an order-completion page, GET/POST product editing, and separate product CRUD pages.
- What you can do after
- Build it from scratch: configure Razor Pages, route requests, handle forms, and assemble database-backed HTML features.
Read how Pro ASP.NET Core 7, Tenth Edition explains Razor Pages →
.NET in Action, Second Edition
A Razor page is an ASP.NET Core web page that combines view rendering with request-handling logic without requiring an explicit controller.
- How it is used
- Builds server-rendered ASP.NET Core web interfaces when page-level request handling is simpler than introducing explicit controllers.
- How deep it goes
- Explains directives, routing setup, PageModel conventions, and working GET and POST implementations, but covers only basic Razor syntax.
- Examples
- Demonstrates home and error pages plus an ASCII-art form using Figgle and a shared navigation layout.
- What you can do after
- Build it from scratch as a functional ASP.NET Core page with markup, code-behind, GET or POST handlers, and navigation.
Read how .NET in Action, Second Edition explains Razor Pages →
What to know first
- ASP.NET Web FormsASP.NET Web Forms is a Microsoft server-side web application framework based on page-oriented development, server controls, and event-driven programming.
- web applicationA web application is software that provides functionality through web technologies and is accessed over a network, typically through a browser or other web client.
- HTMLHTML is the standard markup language for structuring content and elements in documents on the web.
Related concepts
- ASP.NET Coreuses · ASP.NET Core is Microsoft's open-source, cross-platform framework for building web applications and services on .NET.
- MapRazorPagesconfigured by · MapRazorPages is an ASP.NET Core endpoint-mapping method that registers an application's Razor Pages with its routing system.
- page directiveconfigured by · The @page directive is a Razor directive that identifies a file as a routable Razor Page.
- PageModelhas part · A PageModel is an ASP.NET Core Razor Pages class containing page state, data, and request-handling logic.
- Razor syntaxuses · Razor syntax is a templating syntax that combines markup with embedded .NET code and directives to generate web content.
Questions about Razor Pages
What is Razor Pages?
Razor Pages is an ASP.NET Core page-focused programming model in which independently addressable pages combine Razor markup with request-handling logic.
Which Manning books explain Razor Pages?
ASP.NET Core in Action, 3e, Pro ASP.NET Core 7, Tenth Edition and .NET in Action, Second Edition.
What should I know before learning Razor Pages?
Manning books that teach Razor Pages usually introduce ASP.NET Web Forms, web application, C# and HTML first.
What are the parts of Razor Pages?
Razor Pages includes PageModel.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


