Razor Pages is a new server-side framework which works on a page-based approach to render applications in .NET Core. They are stored as a physical .cshtmlfile.
They have the HTML and code in a single file, without the need to maintain separate controllers, view models, action methods, etc. We can also have the code separate from the HTML in a different file which is attached to the Razor Page. Both types are shown below in the diagram:
Razor Pages framework is flexible, lightweight, cohesive, page-based, easy to learn and maintain compared to MVC. It can be used in conjunction with traditional MVC (Model-View-Controller) architecture or Web-API controllers.