liveBook · Manning

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.

How 3 Manning books explain it

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 HTML applications for direct browser use, including pages that receive form data.
How deep it goes
Works through template setup, page files, handlers, routing, and binding; defers detailed Razor Pages model binding.
Examples
Uses a template's Home and Privacy pages and a category-filtered to-do list page.
What you can do after
Build it from scratch using the ASP.NET Core Web App template, then add page endpoints and customize their routes.

Read how ASP.NET Core in Action, 3e explains Razor Pages →

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 →

Related concepts

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.