ASP.NET MVC is a programming model for ASP.NET that offers several benefits over the original programming model called “Web Forms”.
Both MVC and Web Forms are built on top of the core ASP.NET framework, meaning they each have access to the same low-level functions such as parsing requests made to the server and formatting responses.
From there MVC and Web Forms take wholly different approaches.
MVC allows URLs to be defined by the developer, whereas in Web Forms generates URLs based the project’s file structure.
Some developers may find the Web Forms model easier to use, but it may produce undesirable URLs and could cause issues for SEO.
MVC allows full control over HTML, whereas Web Forms allows only limited control.
Some developers may find AJAX difficult to understand and prefer the hands-off approach offered by Web Forms, however for advanced scenarios control is a must.
There is also a much larger community of developers supporting open source libraries and many are easier to find information on than Web Forms’ own proprietary model.
Unit testing allows problems to be found earlier in development and makes changes in code easier to manage. Some teams may choose to follow a process of test-driven development (TDD) where tests are written before code.
Choosing the Right Model
In general MVC emphasizes control while Web Forms emphasizes automation. While MVC offers many benefits over Web Forms, they do come at a cost.
MVC requires more knowledge of front-end web technologies. For basic websites MVC may take more time to implement than Web Forms. There are also many more Web Forms developers as well as projects written in Web Forms to maintain.
However, as front-end technologies are becoming more important the investment in MVC looks to be the smart choice. For many projects today MVC may actually save time over Web Forms due to their complexity on the front-end.
Learn Web Technologies
The argument for MVC cannot be made without making the argument for front-end web technologies in general.
Many concerns that Web Forms shield from developers are exposed in MVC, and without knowing what you’re doing it is possible to make websites that are vulnerable to security exploits, among other things.
The best way to get started is to check out the official website for ASP.NET MVC, and check back here for more articles on MVC as well! -R