Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial - Jon Galloway

Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

A couple weeks ago we did a soft release of a new ASP.NET MVC 2 Tutorial and Sample Application I’ve been working on over the past few months, the MVC Music Store. The source code and an 80 page tutorial are available on CodePlex. I’m also working on a video tutorial series for the ASP.NET website which will walk through building the application. After that, it’s time to talk about a feature length film and a worldwide MVC Music Store On Ice tour, but the plans aren’t completely set just yet.

MVC Music Store

MVC Music Store - Shopping Cart

MVC Music Store - Admin

Everything’s under friendly licenses - the source is available under Ms-PL license, and the tutorial is under Creative Commons Attribution license. The data for the application is based on the Chinook database, which is also under Ms-PL license.

Who is this for?

This tutorial is mostly written for beginners to ASP.NET MVC, including folks who are kind of new to web development. We already have a few tutorials out there at the intermediate to advanced developer level (Nerd Dinner, MVC Storefront) if you’re looking for something more advanced, but if you want to start with the basics of how ASP.NET MVC works before diving into repositories and IoC and TDD, this is a great place to get started.

However, I think it’s also pretty useful if you’ve got some experience with ASP.NET MVC 1.0 but want to get a look at using some of the new features in ASP.NET MVC 2, especially model validation.

What’s it cover?

Store features:

  • Store browse
  • Shopping cart
  • Checkout
  • Membership and registration
  • Basic administration (add and edit albums)

Tutorial covers:

  • ASP.NET MVC Basics
    • Controllers
    • Views
    • Models and ViewModels
  • Data access using Entity Framework 4
  • Model Validation
  • Editor and Display Templates
  • Use of ASP.NET Membership system
  • Client-side enhancements
    • Client-side validation
    • AJAX update showing both Ajax.ActionLink and jQuery

How’s the code?

I think this is a great tutorial sample, and I’m really proud of it. I spent a lot of time on it, and I had several reviews with Scott Guthrie and Scott Hanselman, as well as Phil Haack and Brad Wilson from the ASP.NET team. I’m hugely thankful to all of them for their input and patience, but of course I’ll take responsibility for any errors or killed kittens.

This is a beginner tutorial, so the code focuses on communicating how ASP.NET MVC works. There are no dependencies, and things are written using a minimum of code and complexity. If you do see something that makes you angry or sad please let me know, but keep in mind that we’re not trying to build an enterprise store system here. As it is, the tutorial is 80 pages long, so I really tried to keep as much out as possible and focus on the basics.

Where next?

I’ve already gotten some good feedback on the discussion forum and at the Toronto Web Camp, where we used it as lab, so I’ll be updating the document and tutorial to get to a 1.0 release.

I’m working on a video series for the ASP.NET website.

I’ve also heard that people are interested in advanced, real-world scenarios, so that’s something I’ll be looking at next. Please let me know if you have any thoughts or requests there.

Tailspin Spyworks Web Forms Sample

If you haven’t seen it, check out Joe Stagner’s Tailspin Spyworks sample - an update of the popular iBuySpy application for ASP.NET 4 with all the new goodies.

Published Wednesday, May 12, 2010 9:04 AM by Jon Galloway

Comments

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

I did this tutorial at Webcamp Toronto this past weekend. I found this to be very helpful in what you can do. In capabilities and learning this was as helpful as the nerd dinner was in getting into MVC 1.0.

Wednesday, May 12, 2010 1:26 PM by mike johnson

# Twitter Trackbacks for Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial - Jon Galloway [asp.net] on Topsy.com

Pingback from  Twitter Trackbacks for                 Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial - Jon Galloway         [asp.net]        on Topsy.com

# Introducing the MVC Music Store – MVC 2 Sample Application and … | ASP WebDev Insider

Pingback from  Introducing the MVC Music Store – MVC 2 Sample Application and … | ASP WebDev Insider

# Chris Holmes Online » Blog Archive » ASP.NET MVC 2 Sample Application and Tutorial

Pingback from  Chris Holmes Online  » Blog Archive   » ASP.NET MVC 2 Sample Application and Tutorial

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

@mike - Great, good to hear it!

Wednesday, May 12, 2010 6:18 PM by Jon Galloway

# Custom Bots ?? Blog Archive ?? Installing Ajax Toolkit for Visual … | AJAX WebDev Insider

Pingback from  Custom Bots ?? Blog Archive ?? Installing Ajax Toolkit for Visual … | AJAX WebDev Insider

# Daily tech links for .net and related technologies - May 13-16, 2010

Daily tech links for .net and related technologies - May 13-16, 2010 Web Development Integrating Twitter

Thursday, May 13, 2010 5:59 AM by Sanjeev Agarwal

# Daily tech links for .net and related technologies – May 13-16, 2010 | OOP - Object Oriented Programing

Pingback from  Daily tech links for .net and related technologies – May 13-16, 2010 | OOP - Object Oriented Programing

# ASP.NET MVC Music Store

ASP.NET MVC Music Store

Thursday, May 13, 2010 9:28 AM by Inside .NET - ADO.NET, ASP.NET, C#

# Everybody Loves Raymond Complete Series BOX ONLY? | TV drama

Pingback from  Everybody Loves Raymond Complete Series BOX ONLY? | TV drama

# how can i design a transaction ER diagram of a store? | TV drama

Pingback from  how can i design a transaction ER diagram of a store? | TV drama

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

This is a very nice little project - thanks for taking the time to put it together. - Eric

Friday, May 14, 2010 7:56 PM by Eric N

# list of all sample music the apple imac comes with… thanks? :Business Supplies

Pingback from  list of all sample music the apple imac comes with… thanks? :Business Supplies

# I bought some condoms from the store today and you know what the store clerk said to me? | ?????????_???????????????_???????????? ?????????_???????????????_??????,??????,??????,??????,?????????

Pingback from  I bought some condoms from the store today and you know what the store clerk said to me? | ?????????_???????????????_???????????? ?????????_???????????????_??????,??????,??????,??????,?????????

# ASP.NET MVC 2 RC issues | Net News | NewsWo.com | ASP WebDev Insider

Pingback from  ASP.NET MVC 2 RC issues | Net News | NewsWo.com | ASP WebDev Insider

# Where can I buy the suit Monk wears in the tv episodes? | TV drama

Pingback from  Where can I buy the suit Monk wears in the tv episodes? | TV drama

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

Jon,

      I got lost at page 30 of your guide. I'm getting red squiggly lines. I'm also not clear where between pages 29 and 32 I'm supposed to press F5 and compile to see if everything is working. You might want to add a few checkpoints.

Now I'm off to go figure out why I'm getting errors...

Monday, May 17, 2010 5:24 PM by Dan Cavita

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

Figured out the errors I was getting. I think you should spell out more carefuly on say page 30 that we need to change the View data class drop down. Didn't realize that and just clicked ok.

Another suggestion, page 41. You meion making the change to the Store Details page which will load and Album who ID matches the parameter value. Took me a sec to figure out what you meant...maybe include an example URL like you did for Album on page 40.

Monday, May 17, 2010 6:29 PM by Dan Cavita

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

A few other quick things:

On page 43 you need to include: using MvcMusicStore.Models;

On page 47, for clarity you might want to mention that you're adding the <%@ Import Namespace="MvcMusicStore.Helpers" %> to the storemanager view.

On page 50, you need to include: using MvcMusicStore.ViewModels;

Monday, May 17, 2010 6:57 PM by Dan Cavita

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

Just returning to work on the lab. I'm confused about the Album.ascx on page 53. Am I supposed to create this Album.ascx?

Tuesday, May 18, 2010 12:31 PM by Dan Cavita

# Ultrasound Demo on Trimble Windows Mobile 6 Rugged Handheld | Droid Reviews

Pingback from  Ultrasound Demo on Trimble Windows Mobile 6 Rugged Handheld | Droid Reviews

# Online Shopping Cart Tutorial

Pingback from  Online Shopping Cart Tutorial

Tuesday, May 25, 2010 5:22 AM by Online Shopping Cart Tutorial

# mystery shopper Global Services? | Personal services

Pingback from  mystery shopper Global Services? | Personal services

Thursday, May 27, 2010 5:41 AM by mystery shopper Global Services? | Personal services

# What is your opinion regarding giving up a Managerial job for Home Cleaning personal services? | Personal services

Pingback from  What is your opinion regarding giving up a Managerial job for Home Cleaning personal services? | Personal services

# How to add music to your private videos on windows movie maker?

Pingback from  How to add music to your private videos on windows movie maker?

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

This is the best into to ASP.MVC 2 and EF4 out there - exactly what i needed! Thanks for the effort you've put it. Had to link to this :) Everyone should know about it

Tuesday, June 01, 2010 6:07 AM by British Developer

# Learning before the Web camp - Review or Delete at Will - Rodaw

Pingback from  Learning before the Web camp - Review or Delete at Will - Rodaw

# Baseline Killer, 2008

Pingback from  Baseline Killer, 2008

Saturday, July 03, 2010 5:23 PM by Baseline Killer, 2008

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

This is great!  Thanks.  Is the music store online like nerddinner.com?

Friday, August 06, 2010 1:54 PM by Jim

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

Cant get browse genre items displayed in MVC Music Store application.

Using Windows 7, when writting code for store controller </Select from <%: Model.NumberofGenres%>genres:</> and <%genrenames%> not right.

Says only assignment, call, increment, decrement and new object expressions can be used as a statem

Wednesday, August 25, 2010 10:43 AM by markt264

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

This tutorial is amazing. Very good work. Of course it helps that MVC2 in itself is quite amazing.

I read about it earlier, but am only now getting my hands dirty. Thanks to this tutorial, the part about getting my hands dirty is purely figuratively speaking :)

Friday, September 03, 2010 1:05 PM by Niels Brinch

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

I am expecting some different idea from your side. You always represent some new thought in your post.

Monday, October 25, 2010 11:00 PM by cheap chanel bags

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

Write very well, there are some others that resonate.

Monday, November 29, 2010 1:05 AM by Coach Outlet

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

I will recommend my friends to read this.I will bookmark your blog and have my children check up here often.I am quite sure they will learn lots of new stuff here than anybody else!

Thursday, December 02, 2010 12:35 AM by nike dunk sb

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

Doubt is the key to knowledge.

-----------------------------------

Saturday, December 18, 2010 2:35 AM by ipad app developers

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

Только тут <a href="http://www.mikroavtobus.com.ua">аренда микроавтобуса</a> по Киеву и Украине

Tuesday, January 04, 2011 3:39 AM by DanilovTimofej

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

I was halfway through this tutorial when I came back from lunch to find that it is now for MVC 3, and not MVC 2. This means that all the views are different, as it uses the ASP.Net Web Pages “Razor” Syntax

Are the old MVC 2 tutorials available somewhere? It was all very confusing for a while. I felt like I'd slipped into a parallel dimension!

Thursday, January 13, 2011 5:12 PM by Paul

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

"Of program, what a wonderful web site and informative blogposts, I will add backlink - bookmark this website? Regards,Reader."

--------------------------------------------------------------------    

East Asian Languages and Civilizations

Monday, January 17, 2011 4:25 PM by projector reviews

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

I'm getting a SQLException, when trying to generte the Entity Framework model. I'm using VS 2010, SQL Express 2008 R2, Win 7. Selected teh mdb in another directory and VS 2010 automatically copied it into App_Data.

Friday, January 21, 2011 1:50 PM by Ralph Compton

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

It is extremely interesting for me to read this post. Thanx for it. I like such topics and anything that is connected to this matter. I definitely want to read a bit more soon.    

Nicky  Smith    

<a href="www.latinescortlondon.com/">London escorts spanish</a>

Wednesday, February 23, 2011 10:41 PM by Nicky Smith

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

I looked at the MVC2 Shopping Cart as I was creating my shopping cart app. However, I think the one that I have created covers more technology related to MVC2

christianfindlay.blogspot.com/.../shopping-cart-in-mvc2.html

Tuesday, March 01, 2011 4:58 AM by Christian Findlay

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

It is certainly interesting for me to read the article. Thank author for it. I like such topics and anything connected to this matter. I definitely want to read a bit more on this blog soon.        

Whitny  Flouee      

<a href="rome-escort.info/">anita roma escort</a>

Tuesday, March 15, 2011 8:52 PM by Whitny Flouee

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

It is rather interesting for me to read this blog. Thank author for it. I like such topics and anything that is connected to this matter. I would like to read more soon.          

Sara  Pingtown          

<a href="milanescorts.com/">escort girls milan</a>

Friday, April 01, 2011 3:31 AM by Sara Pingtown

# re: Introducing the MVC Music Store - MVC 2 Sample Application and Tutorial

I love your blog, you should add an RSS feed feature so I can get automatic notifications of new blogs. If you set one up please email me! i will bookmark you for now. Again Excellent Blog!

Thursday, December 01, 2011 11:26 AM by Home Security

Leave a Comment

(required) 
(required) 
(optional)
(required)