A Guide to Learning ASP.NET MVC Beta 1

Now that ASP.NET MVC Beta 1 is out, how do you learn how to use it? How do you learn how to build ASP.NET MVC applications? Here are my recommendations.

The main website for all information related to ASP.NET MVC is located at:

http://www.ASP.net/mvc

This website contains a large number of videos, tutorials, and links to blogs and documentation. Here is how I would suggest navigating all of this material.

First, I would recommend watching the video Creating a Tasklist Application with ASP.NET MVC located at:

http://www.asp.net/learn/mvc-videos/video-395.aspx

In this 38 minute video, I walk through creating a very basic MVC application from start to finish. The sample application is nothing fancy. The goal of the video is to give you an overall sense of the different parts of an ASP.NET MVC application.

If you want to learn how to build a more complex application then I would recommend that you watch the series of Pair Programming videos that I created with Paul Litwin. In these videos, we build a Workout Log application. This is a simple database driven application that includes form validation. You can view this series of videos here:

http://www.asp.net/learn/mvc-videos/#MVCPairProgramming

If you are interested in watching a series of videos that really dive into the advanced features of building an ASP.NET MVC application, then I would suggest that you watch Rob Conery’s series of videos on building an e-commerce application:

http://www.asp.net/learn/mvc-videos/#MVCStorefrontStarterKit

Next, to get a better understanding of each of the different features of ASP.NET MVC, I would recommend that you take a look at the preview of the ASP.NET MVC Quickstarts. The Quickstarts provide you with basic documentation on each of the different features of the ASP.NET MVC framework:

http://quickstarts.asp.net/previews/mvc/

Next, take advantage of the ASP.NET MVC tutorials and videos located at:

http://www.ASP.net/mvc

The tutorials and videos are cross-linked. You can choose to either watch the video or read the corresponding tutorial. The written tutorials are available in both VB.NET and C#. Here’s a list of the current tutorials available at the www.ASP.net/mvc website:

Creating a Tasklist Application with ASP.NET MVC

Stephen Walther builds an entire ASP.NET MVC application from start to finish. This tutorial is a great introduction for people who are new to the ASP.NET MVC Framework and who want to get a sense of the process of building an ASP.NET MVC application.

Understanding Models, Views, and Controllers

Confused about Models, Views, and Controllers? In this tutorial, Stephen Walther introduces you to the different parts of an ASP.NET MVC application.

Understanding Controllers, Controller Actions, and Action Results

In this tutorial, Stephen Walther introduces you to ASP.NET MVC controllers. You learn how to create new controllers and return different types of action results.

Understanding Views, View Data, and HTML Helpers

What is an ASP.NET MVC View and how does it differ from a HTML page? In this tutorial, Stephen Walther introduces you to Views and demonstrates how you can take advantage of View Data and HTML Helpers within a View.

An Introduction to URL Routing

In this tutorial, Stephen Walther demonstrates how browser requests get mapped to controller actions through URL Routing. You also learn how to create a custom route that displays different blog entries depending on the date passed in a URL.

Preventing JavaScript Injection Attacks

Prevent JavaScript Injection Attacks and Cross-Site Scripting Attacks from happening to you. In this tutorial, Stephen Walther explains how you can easily defeat these types of attacks by HTML encoding your content.

Creating Unit Tests for ASP.NET MVC Applications

Learn how to create unit tests for controller actions. In this tutorial, Stephen Walther demonstrates how to test whether a controller action returns a particular view, returns a particular set of data, or returns a different type of action result.

Creating Custom HTML Helpers

Create new HTML Helpers to make it easier to generate view content. Stephen Walther demonstrates two simple methods of creating new HTML Helpers.

Creating Model Classes with LINQ to SQL

Learn how to create data access classes by taking advantage of Microsoft LINQ to SQL. In this video tutorial, you learn how to use a LINQ to SQL DataContext class directly within a controller. You also learn how to use the Repository Pattern to create testable and flexible database-driven applications.

Displaying a Table of Database Data

Need to display a set of database records in an MVC view? Learn two methods of displaying records in an HTML table. You learn how to perform all of the formatting inline. You also learn how to create a template with an MVC partial.

Using ASP.NET MVC with Different Versions of IIS

In this tutorial, you learn how to use ASP.NET MVC, and URL Routing, with different versions of Internet Information Services. You learn different strategies for using ASP.NET MVC with IIS 7.0 (classic mode), IIS 6.0, and earlier versions of IIS.

Creating Page Layouts with View Master Pages

By taking advantage of view master pages, you can create a common layout for the pages in your ASP.NET MVC application. In this tutorial, Stephen Walther introduces you to view master pages. You learn how to create a two-column page layout.

Passing Data to View Master Pages

In this tutorial, Stephen Walther explains how you can pass database data to a view master page. He demonstrates how to create an Application controller that modifies the view data returned by every controller action within an ASP.NET MVC application.

Understanding Action Filters

In this tutorial, you are introduced to action filters. You learn how action filters work and how to implement custom action filters. We create a custom action filter that logs the stages of processing a controller action and action result to the Visual Studio Output window.

Finally, there is a lot of really great ASP.NET MVC information in blogs. These are the blogs that I would read on a daily basis:

ScottGu’s Blog – Scott Guthrie’s blog is the best place to get the latest ASP.NET MVC announcements. He also writes really clearly written walkthroughs that describe how to build basic MVC applications.

Haacked – Phil Haack is the Program Manager for ASP.NET MVC.

Stephen Walther on ASP.NET MVC – My blog on ASP.NET MVC. I’ve written over 40 tips on building applications with ASP.NET MVC. I’ve also been building two complete sample applications.

Computer Zen – Scott Hanselman’s web log. Scott is another member of my team. His blog is a great source for all technical information on .NET.

WekeRoad – Rob Conery has been building an entire ecommerce application with ASP.NET MVC.

Hope these resources help! If you have any other recommendations for sources of information on ASP.NET MVC, then please leave a comment. Remember that you can always find the latest ASP.NET MVC information by visiting the primary Microsoft ASP.NET MVC site:

http://www.ASP.net/mvc

Discussion

  1. Robert says:

    I wrote a couple of german tutorials and blogposts for ASP.NET MVC: http://code-inside.de/blog/tag/aspnet-mvc/

  2. http:// says:

    In using the new beta, I notice that if I set up a route that maps to something like this to search for “tomato paste”: http://localhost:51223/search/%22tomato%20paste%22

    An error occurs: Illegal characters in path.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentException: Illegal characters in path.

    For whatever reason, the double quote causes an error – but seemingly only the double quote. Why is this? It is encoded and should be fine. Further, the error is not even one that is caught in debugging. This occurs when using the built in VS web server.

    Any ideas?

    Ben

  3. http:// says:

    Hi Stephen, thanks for your job!!!
    This is a great MVC developer check-list.

    I recommend: http://sessions.visitmix.com/.

  4. jdanforth says:

    Stephen, that is a great list of resources. Cheers!

    /Johan

  5. Thanks Stephen..This post is a good kickstart point for ASP.NET MVC..

    Suprotim
    ASP.NET MVP

  6. Mariusz says:

    Hi Stephen, thanks for your list of good articles and ressources. I saw a couple of your MVC videos and i have noticed that you can select nUnit as test framework while creating a new MVC project.
    Can you give me a hint, how i can get the selection of nUnit in the Creat Project Dialog of ASP.NET MVC? I have nUnit 2.4.8 and the actuall TestDriven.Net installed, but i can only select Microsoft Unit Test :-/

    Thx in advance ;-)

  7. sarah says:

    I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to

    say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
    Sarah
    http://www.thetreadmillguide.com

  8. Mark says:

    Great list of links for starting MVC – just for info there are a few messed up hyperlinks from “Creating Custom HTML Helpers” onward. Thanks.

  9. Very cool blog you have here. Been learning a thing or two from it.
    Thought I would leave my first comment. Will be checking this out often.

    Walter

    http://termlifeinsurance2.com

  10. jenna says:

    i love reading your blog whenever i can, i dont often get the time these days, but usually have a quick read in my dinner break or just after i get home from work, sometimes its quite interesting reading – thanks.

  11. bella says:

    im starting a course on programming soon, im hoping to pick up on a few tips reading your blog.

  12. Hi stephen..
    thank for this tutorial..
    i enjoy here..

  13. thanks stephen for the useful links.

  14. Petra says:

    Hi! It’s a really cool page!!! Do you want to see my page?

  15. tammy says:

    i really love reading your website , although i just started doing overtime recently, so it is less frequent now

  16. I am so impressed with the material. All I could say to myself “wow”, what a material. I want to write the application so clean such as this one, but many times delivery challenges makes us go to old school coding.
    Great Stuff!

  17. Really such a useful links. Thanks Stephen for sharing very useful links.

  18. FR E RW W Great article, though – thanks!

  19. f4 q5 I tried to mock a call to a Linq to SQL query, but I am struggling.

  20. Degrees says:

    Also keep in mind, this isn’t even an authentication issue. Some sites show info particular to a user without authentication such as the sites that ask you if you want to meet other singles near your city. Caching that wouldn’t make sense unless you varied the cache by user or by location. No authentication is involved in that scenario.
    buy degrees | life experience degree | affordable degrees

  21. Degrees says:

    if you start output caching per-user content, your cache is likely to fill so quickly that it becomes useless. The scenario for output caching privileged content really needs coarser granularity; e.g. per role.
    online degree program | fake degrees

  22. f2u
    I believe it is a promising (currently version 4.0). So I would stick with it.. thanks