NET 6 - Razor Pages - Project Structure

Last modified: March 24, 2022

Since there is not WebForm in ASP.NET Core or ASP.NET5/6, they have similar thing called Razor Pages. The main difference is WebForm has Form Element in Razor Page is that WebForm has Form Element (e.g. Grid View to list record) whereas Razor Pages has Razor syntax. They both have code behind and URL is based on file path based.

The following folder structure is when you create an ASP.NET 6 Razor Pages application in Visual Studio.

structure

Program.cs

An ASP.NET 6 application is a console application under the hood, where it create a host for web application. The main difference between ASP.NET 6 MVC and ASP.NET 5 MVC is, there is no start up file. Everything is in Program.cs startup