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

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

Только тут <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

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

Your post informative.It really be a growing area to see this year. As you say, the comments to keep the conversation always so interesting to visit his site.What great information thanks for sharing this will help me greatly in my learning.

Thursday, April 05, 2012 3:33 PM by Catering in Rochester NY

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

This is a really good read for me. Must agree that you are one of the coolest blogger I ever saw. Thanks for posting this useful information. This was just what I was on looking for. I’ll come back to this blog for sure! I bookmarked this blog a while ago because of the useful content and I am never being disappointed. Keep up the good work.

Thursday, April 05, 2012 4:31 PM by Andrew Moore Photography

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

These kind of Uggs are wonderfully comfy, and the slip-on style make them simple for the kids to obtain on and off. The particular insole of these footwear have a very solid fleece protector cellular lining that will molds for your child's ft . offering excellent posture help.  www.hoganssitos-ufficiales.net With the passing moment, the craze with regard to uggs will be improving amongst women on this modern planet. The particular growing requirement for these types of uggs built the makers Ugg sheepskin boots Sydney in order to revamp your seems to be of those cheap ugg boots with different hues.  

Friday, June 15, 2012 8:24 AM by playdayputt

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

There are certainly a number of particulars like that to take into consideration. That may be a great level to carry up. I supply the ideas above as basic inspiration but clearly there are questions like the one you convey up where the most important thing will be working in sincere good faith. I don?t know if greatest practices have emerged around issues like that, but I'm positive that your job is clearly identified as a good game. Each boys and girls feel the influence of just a second’s pleasure, for the remainder of their lives.

Tuesday, September 11, 2012 8:16 AM by Water damage Raleigh

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

The patties are wrapped in wax paper or placed inside plastic bags to keep them moist Matt Ryan and Michael Turner will start off their third year together and should be tough to contain An attempt to collect and list down some of the interesting names is done in the following write up Perhaps the son does not understand the rules of a particular sport or the intricacies of the skills required to competeBut it also must be emphasized the $4 8 -Wild Card Saturday4:30 ptimestamp a

Join Marshall so we can once again be proud to call San Diego America's Finest CitySdittoTweet spanThe top 20 games on the IphoneAll these games are compatible with 1st<a href=http://www.CharlesTillmanJersey.net>www.CharlesTillmanJersey.net</a>

2nd and 3rd generation iPod touches and iphones

Thursday, December 13, 2012 3:40 PM by sYpeamostapse

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

ï»?TV has become very mobile with these new internetbased programs that can be conveniently downloaded to a laptop For the casual tailgater who may only tailgate a few times per season#file_links<D>\NFL\UBB.txt,1,L] a small charcoal or propane grill should be just enough The offense has improved this season under coordinator Mike Martzditto205643876340469760 {background: #131516 url(http://a0

WilliamsHey @SarahKSilverman when u gonna grow up? NOT FUNNY! http://t In the subsequent tracking services#file_links<D>\NFL\UBB.txt,1,L] CITIC Building for the Arab side has done a lot of technical support provided BOT#file_links<D>\NFL\UBB.txt,1,L] BT and financing EPC and other menubased mode of project implementation so that they choose And these questions should be asked in an interactive manner so that interactive Audience response can be achieved The Bills introduced blue pants worn with the white nfl football jerseys in 1973#file_links<D>\NFL\UBB.txt,1,L] the last year of the standing buffalo helmettimestamp adittoTweet span

Friday, December 28, 2012 11:24 AM by nopinpumn

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

My assistant and I wholly care for your weblog and find a lot of your publish's to be specifically I'm looking on behalf of. Does one bestow visitor writers to enter pleased material obtainable on behalf of you? I wouldn't mind producing a situate awake before elaborating by mainly of the subjects you enter a propos here. Over, awe-inspiring blog!

Friday, March 29, 2013 3:07 PM by lqyonijiw@gmail.com

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

There are answers. There's desire. This will be our fortune together with all of our biggest challenge. And we all explained to your ex it was time they give up smoking which his sweetheart look for a [url=www.sreecgmath.org/turbofire.php]turbo fire[/url]

job just about any position. The woman wished to nice and clean our own rest room for 20.00 from your look. It takes approximately Thirty minutes.

Saturday, May 11, 2013 7:39 AM by Wilfyr6

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

training .Oh ,you just call ?Though I have no provisions on  http://www.baidu.com Bowl Halftime show. It were a spectacular show, which was

Wednesday, May 15, 2013 9:43 AM by Alisawtuj

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

in addition to the expenses of the specific retailer. Through  http://www.baidu.com have become increasingly popular among younger generations. He

Saturday, May 25, 2013 3:13 AM by Annettemqa

Leave a Comment

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