Difference between asp.net webforms and asp.net mvc?

Please tell me the difference between Asp.net webforms and Asp.net MVC. 

Last updated:1/18/2020 12:57:19 AM

1 Answers

Nishi Tiwari
Nishi Tiwari

  • Rendering Layouts –ASP.NET Web Forms use Page controller pattern approach to render the layouts, ASP.NET MVC uses Front controller approach. In ASP.NET Web Forms, every pages has its own controller. Whereas in ASP.NET MVC, there is a common controller for all the pages.
  •  In terms of separation – There is separation concerns in ASP.Net Web Forms as each page has its own controller. But in ASP.NET MVC, there is a clean separation as view and controller are totally separate.
  • Testing – Automated testing is quite tedious and difficult in ASP.NET Web Forms. ASP.NET MVC wins this battle as test driven development is quite simple in this approach.
  • Development model – ASP.Net Web Forms follows a conventional even-driven development model, whereas ASP.Net MVC follows MVC pattern-based development model.
  •  State management –ASP.NET Web Forms have state management techniques like view state or sessions, ASP.NET MVC doesn’t have any state management techniques.
  •  Page life cycle is used by the ASP.Net Web Form model, but there is nothing like page life cycle in ASP.Net MVC. Request cycle is used in ASP.Net MVC.
  • With lots of control libraries and limited knowledge of other technologies, ASP.NET Web Form is also called a rapid application development approach. And there is nothing like RAD in ASP.Net MVC. It reduces the productivity of the developers.
  • ASP.Net Web Form works best for the developers having issues with the HTTP/HTML model. ASP.NET MVC requires knowledge to understand how it works.
  • ASP.NET Web Forms include user controls to enable code re-usability whereas ASP.Net MVC uses Partial views to enable code re-usability.

Answer