ASP.NET Web Forms follows Page controller pattern for rendering layout, whereas ASP.NET MVC follows Front controller pattern. In Page controller pattern, every page has its own controller, i.e., code-behind file that processes the request. In Front controller pattern, a common controller for all pages processes the requests.
ASP.NET WebForms
|
ASP.NET MVC
|
Follows Page-Controller pattern. Each page has a code-behind class that acts as a controller and is responsible for rendering the layout. | Follows Front-Controller pattern. There is a single central controller for all pages to process web application requests and facilitates a rich routing architecture |
Both Controller (code behind) and View (.aspx) are tightly coupled. So It is tedious to test and maintain | ASP.NET MVC enforces a "separation of concerns" and is loosely coupled. The Model has no knowledge on View and View has no knowledge on Controller. So testing and maintaining is very easy. |
The View is called before the Controller. | Request is routed to the Controller's action and the action renders the View |
Test driven development is difficult as you cannot test controller without instantiating a View. | Test driven development is easier in ASP.NET MVC. You can test your Controller without instantiating a View. |
WebForms manages state by using view state and server controls. | ASP.NET MVC does not maintain state information by using view state |
WebForms supports event-driven programming | In ASP.NET MVC is not based on event-driven programming model. |