MVC (Model View Controller) is a framework for building web applications and is one of 3 ASP programming models. There’s an ongoing debate whether MVC should replace .Net web forms or not. In this article I will review the advantages and disadvantages of ASP.Net Web Forms and MVC,
.Net Web Forms: An ASP.Net Web Form lets you create and build dynamic web applications that users request using their browser. A web application can be written using a combination of HTML, client-script, server controls, and server code. When any given user request a page of the web application, such page is compiled and executed on the server by the framework. Then the framework generates the HTML and the web browser renders it.
1. Provides RAD development (Drag and drop controls. Apps with validation can be quickly developed by setting properties on control.)
2. Easy development model for developers those coming from winform development.
1. No control of the HTML that is being created when using RAD. Of course you develop faster, but you don’t have much control of the HTML produced in the page.
ASP.Net MVC: The MVC is a design patter for creating a successful and efficient user interface to underlying data models. It has been available for around 30 years, and has been implemented in the .Net Frameworks. It is a lightweight alternative to traditional ASP.Net Web Forms and it is integrated with all ASP.net features.
1. Multiple Forms: You can have as many forms as you want on any given page.
2. Easy to learn/implement/develop (It is similar to other frameworks)
3. Test Driven Development
4. Separation of Concern
1. Views are written from scratch by the developer
2. Must have a knowledge of HTML and CSS
You can say which one is better than the other one. Each has its advantages and you should study both of them before starting your project. If you don’t have much time available for doing a project, you should use ASP.Net web forms, otherwise you can use ASP.Net MVC forms.
This concludes ASP.Net Web Forms or MVC: Which one is better?