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 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.

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 →

What to know first

Related concepts

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.