Skip to content

RazorPages

Mehmet Özkaya edited this page Mar 25, 2019 · 1 revision

Razor pages is latest Default Web Application template of Asp.Net Core. Razor Pages, which comes into our lives with ASP.NET Core 2.0, is a programming model that we can develop page-based web applications in the ASP.NET Core MVC infrastructure. You can completely think of it as an improved shell on the MVC infrastructure. A new model designed to reduce the number of folders in MVC templates and improve page-based applications more easily.

Razor Pages has an appropriate approach to single responsibility. First of all, fewer files are used to develop a simple html page and the file hierarchy is simpler. As you know, the asp.net mvc framework we used to develop dotnet web application in general had many page related actions inside the controller. We kept the actions of all pages connected to the controller in a single file. In this case, the controller file is growing, so the readability of the code is decreasing and creating a mental complexity. For multi-page web applications this is actually a handicap.

Razor Pages offers an advantage in this respect. Mvc has been developed on the structure, mvc supports everything that exists. (Routing, ModelState etc,). This structure provides us with a compact and hierarchical and a fast and practical application framework that we have not previously seen.

AspnetRun repositories will be updated regularly, so when Blazor will be avaible, this repo also will be Single Page Web Applcation over the Web Assembly. We are following Microsoft Web Technologies very closely so we will update accordingly Microsoft Default Web Application stack.

Clone this wiki locally