So, You Want to Learn ASP.NET MVC?
Friday, September 4, 2009 at 3:07PM |
Kevin Rohrbaugh It’s true that some members of the .NET community may have already become bored with MVC 1.0, moving on to the preview release of MVC 2.0. The posts on Twitter, however, suggest that the vast majority of .NET developers are still coming to terms with the six-month old framework.
If you’re one of those developers who has heard about MVC, but not yet spent much time digging in, this post will hopefully outline some options for how you can best get up-to-speed with the newest web framework in the .NET ecosystem.
Books & Tutorials
There are quite a few books and tutorials about MVC available, but I’ve found the following two to be the most beneficial.
NerdDinner Tutorial
- What it is: Published as part of Wrox’s Professional ASP.NET MVC 1.0, the NerdDinner tutorial remains the preeminent ASP.NET MVC tutorial, walking you through building a complete MVC application using LINQ to SQL.
- Why it’s worth your time: It focuses on the bare essentials of the framework, only briefly touching on advanced topics like dependency injection and testability. While some have cited this as a limitation, it’s beneficial if you’re interested in quickly getting exposure to MVC and deciding if it’s worth further investigation. Best of all, it’s available free online in either PDF or HTML formats, which is good since the rest of the Wrox book is rather mediocre.
- Who should check it out: If you’ve heard about MVC and you just want to see if it’s worth investigating, this is a great place to start. If you want to dive deep into dependency injection and holistic unit testing, alternative data access strategies or other more advanced topics related to MVC, the next option is a better fit.
Pro ASP.NET MVC Framework by Steven Sanderson
- What it is: Often cited as the best of the first wave of ASP.NET MVC books, Steven Sanderson’s Pro ASP.NET MVC Framework provides a deeper and more complete look at MVC.
- Why it’s worth your time: It provides chapters introducing the MVC pattern, walks you through the SportsStore application tutorial and covers topics like dependency injection and unit testing more comprehensively than the Wrox book.
- Who should check it out: If you enjoy learning about technologies through books, this is all but required reading. At 550 pages, it’s best for the developer who has dipped their toe in the MVC waters and decided that they definitely want to invest the time in gaining a solid understanding of the framework.
MVC Sample Applications
Books and tutorials are a good approach to learning, but some people prefer to simply jump in and read some code. Here are a few MVC code-bases that can help you round out your understanding of the framework.
- NerdDinner: The code from the Wrox book mentioned above.
- SportsStore: The code from Steven Sanderson’s book, mentioned above.
- Oxite: A blogging engine
- MiniUrl: A link shortening application
Further Resources & Advanced Topics
If you’ve dug through some of the above resources and decided that MVC is something you’d like to start developing real applications in, the following resources and projects can help. Several of these items could be the topic for dozens of posts, so they’re mentioned here for awareness more than in-depth coverage.
- ASP.NET MVC Cheat Sheets: These provide a handy overview of several key aspects of the framework; they’re great for when you’re getting started with actual development on the framework.
- MvcContrib: An open-source project that provides several extensions to MVC as well as integrations with other frameworks (such as Inversion of Control and alternative view engines).
- Spark View Engine: An alternative view engine for MVC (and MonoRail) that focuses on HTML syntax over the embedded C# syntax common in the default Web Forms engine.
- Sharp Architecture: An architectural framework for building MVC applications with NHibernate. It also includes a Northwind sample application that’s worth taking a look at.
Common Issues
As people dig in to ASP.NET MVC, a couple of common issues seem to crop up repeatedly. The following posts may help address these pitfalls.
- Running ASP.NET MVC in IIS6: A lot of shops are still running under IIS6 and getting MVC to run there with extension-less URLs (which most of the tutorials use) is a common problem. Fortunately, Phil Haack has a rather complete write-up on what your options are.
- Bin Deploying MVC: Depending on your hosting environment, ASP.NET MVC may not be installed to the GAC, but Phil Haack has us covered in another post on bin deploying the framework.
Wrapping Up
While this is a lot of stuff to look through, picking a few of the resources should give you a taste of the framework, and allow you to decide if further investigation is warranted. MVC is a big change from Web Forms, so switching is likely to take some time. Hopefully the links above will let you quickly decide whether or not it’s worth the investment.

Reader Comments