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.

URL Structure

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.

HTML

MVC allows full control over HTML, whereas Web Forms allows only limited control.

Many 3rd party JavaScript libraries and CSS frameworks require specific HTML tags or class names in order to work properly. SEO can also be affected by the types of tags you use.

AJAX

MVC allows for a wide variety of JavaScript AJAX libraries to be used including jQuery, whereas Web Forms contains its own proprietary model which seeks to abstract developers from writing AJAX code.

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.

Testability

MVC allows for a clean separation of concerns, meaning that unit tests can be written for individual components more easily, whereas Web Forms simplistic structure makes writing unit tests difficult.

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.

My advice is to have a solid grasp on fundamentals such as HTML, CSS, JavaScript, and the HTTP protocol before diving into a down-and-dirty framework like MVC.

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.

Next Steps

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