Web Forms Vs MVC
Web Forms | ASP.NET |
Use Code behind technique that is divided into two part .aspx file for View and .aspx.cs/.aspx.vb for Code file | Uses MVC design pattern based development model, that manage the application into separate 3 folders Model, View, Controller |
ASP.NET Web Form uses server controls | ASP.NET MVC uses html helpers |
ASP.NET Web Form supports view state for state management at client-side | ASP.NET MVC does not support view state |
ASP.NET Web Forms model follows a Page Life cycle | No Page Life cycle like Web Forms. Request cycle is simple in ASP.NET MVC model |
Provides limited control over Rendered HTML, JavaScript and CSS that is necessary in many cases | Full control over Rendered HTML, JavaScript, and CSS |
It's good for small scale applications with limited team size | ASP.NET MVC is a recommended approach for large-scale applications where various teams are working together |
Asp.Net Web Form has file-based URLs. It means file name exists in the URLs and they must exist physically. | Asp.Net MVC has route-based URLs that means URLs which are redirected to controllers and actions. |
In Web Form, views are tightly coupled to Code behind(ASPX-CS), i.e., logic. | MVC, Views, and logic are always kept separately. |
It has master pages for a consistent look. | Asp.Net MVC has layouts for a consistent look. |
Web Form offers User Controls for code re-usability. | Asp.Net MVC has offered partial views for code re-usability. |
Automatic state management of controls. | Manual state management. |