Share via


ASP.NET MVC Resource Guide

MVCThis post is inspired by the presentation that Patrick Hynds and I gave on ASP.NET MVC at StackOverflow’s DevDays conference in Boston.  Whether you attended DevDays or  happen on this from the web, I hope this is useful for you to learn more about ASP.NET MVC. (Let me know if you have additions or questions.)

Getting Started

ASP.NET MVC is an implementation of the Model-View-Controller pattern on ASP.NET and is freely available via:

ASP.NET MVC 2 Preview 2 is also available, providing a look at the next version.  Note that ASP.NET MVC 2 will also ship with Visual Studio 2010 (itself available as Beta 2).

Learning ASP.NET MVC

So, why is this useful? There’s a 3 minute overview "Why ASP.NET MVC?" for decision makers, and a 10 minute technical “ASP.NET MVC How?” video for developers.

ASP.MVC Learn To start learning ASP.NET MVC, go to www.asp.net/mvc/learn.  There’s tutorials, videos, sample applications, etc. to get you underway.

Then, grab a cup of coffee and sit down to study the Nerd Dinner sample application.  It has plenty of intermediate concepts like testing, repository, validation, and more.

Here are some other places you can turn for more:

Going Deeper

These are intermediate topics we touched on in the Boston session, and pointers for learning more.

Routing

Learning the M-V-C of ASP.NET MVC is only part of the story.  Routing is what takes an inbound web request and maps it to a controller action (and arguments).  There are routing tutorials on the ASP.NET site and on MSDN.

You can also define custom routes, route constraints (a route that is satisfied only when constraints are met), and custom route constraints.

T4 Templates

Code generation in Visual Studio is customizable via T4 templates, and ASP.NET MVC uses these as well.  Need a different view or controller created in your projects?  Change them or add new ones.  They can change for all projects, or you can add/override them in specific projects.

Learn more at T4 Templates: A Quick-Start Guide for ASP.NET MVC Developers.

MVC Contrib

One of the key features of ASP.NET MVC is flexibility in implementation.  Head to MVC Contrib to find additional options for extending and modifying how ASP.NET MVC functions, including:

  • Filters
  • View engines
  • Controller factories
  • Model binders
  • Routing
  • Controllers
  • and more

Key Bloggers Covering ASP.NET MVC

Attendee Questions

We had good questions during and after the DevDays session and I wanted to share details for some of the key ones:

Model Binding

There were a few questions about taking data from a submitted page and getting it to arguments in an action method.  This is well supported via model binders, which let you map posted form data to classes passed as arguments to action methods.

Learn more about model binding at:

ViewModel Pattern

Using the ViewData dictionary is one way to get data to a view, but you can also create classes to contain that data. Called the ViewModel pattern, these classes help to structure and identify the data needed.

You can learn about ViewModel here:

ASP.NET WebForms vs. ASP.NET MVC?

If you’re wondering whether/when to use ASP.NET WebForms or ASP.NET MVC, Rachel Appel has a good blog post and a session recording from Mix ‘09 on the topic.

It’s important to keep in mind that you can mix ASP.NET MVC and ASP.NET WebForms in an application, so this isn’t necessarily an either-or proposition.

 

Let me know if you’ve found something else particularly helpful in learning about ASP.NET MVC.  I’ll be happy to add it.

-Chris

Comments

  • Anonymous
    November 05, 2009
    Hey Chris, Thanks for the great resources. If anybody wants to see a lot of these elements working together, check out Oxite. Going through the Oxite source code was very helpful for me while figuring out ASP.NET MVC. http://www.codeplex.com/Wikipage?ProjectName=oxite