ui-razor-pages

Primary docs: - https://learn.microsoft.com/aspnet/core/razor-pages/ - https://learn.microsoft.com/aspnet/core/tutorials/razor-pages/

Razor Pages

Primary docs:

Choose Razor Pages For Page-Centered Apps

Prefer Razor Pages when requests naturally map to pages, forms, and page-level handlers. This is a strong default for internal tools, CRUD apps, account flows, and admin surfaces.

Core Shape

Enable Razor Pages with:

Use the @page directive to turn a .cshtml file into an endpoint. Keep request logic in the paired PageModel class when the page is more than trivial.

Routing Model

PageModel Guidance

Good Fits

Key Limitation

Do not rely on per-handler authorization with Razor Pages. Microsoft explicitly recommends using MVC controllers when different handlers on the same logical surface need different authorization behavior.

Preferred responses to that limitation:

Organizational Guidance