What are the advantages of MVC over Web forms?

In web forms one aspx file will have one aspx.cs file, which means UI(aspx) is tightly coupled with logic in code-behind (.aspx.cs).

In MVC, one controller can interact with multiple views and one view can interact with multiple controllers and therefore they are loosely coupled.

Advantage of MVC over Web-Forms:

Separation of concerns - The MVC framework provides a clean separation of the UI, business logic and data with the help of MVC architecture.

Multiple view support -  Due to the separation of the model from the view, the user interface can display multiple views of the same data at the same time.

Change accommodation - UI change more frequently than business rules. Now because the model does not depend on the views, modifying view will not affect the model.

Testability - ASP.NET MVC provides better support for test driven development.

Light-weight – In MVC framework, the request and response are bit lighter than webforms.
Full features of Asp.Net – Almost all the features of web-forms are present in ASP.NET MVC.

Post a Comment

Previous Post Next Post