Scott Hanselman

ASP.NET MVC Preview 2 Screencast Tutorials

March 06, 2008 Comment on this post [44] Posted in ASP.NET | ASP.NET MVC | Learning .NET | Microsoft | Mix | Screencasts
Sponsored By

ASP.NET MVC Preview 2 released today and you can head over to to get the new stuff. I put together four new screencasts for this release.

I really feel that a well-done screencast is a great learning tool. Last month I did a survey of you all, Dear Reader, and got 1000 responses and published the results. I took all the comments, stats and general feedback and tried to improve these screencasts. As a result, I am more judicious in my use of PIP (Picture in Picture) and the screencasts are shorter and more to the point.

If you watched the original MVC Screencast, some of the content in videos #1 and #2 will be repeated as it's been updated for Preview 2, but I hope it doesn't waste your time. However, there's new things sprinkled around and a number of changes are called out. Additionally, videos 3 and 4 are completely new content. Video #4 talks about how to use a Mocking Framework to to TDD with MVC and #3 touches on a number of advanced techniques that you can practice at the Mix HOL (Hands-On-Labs).

#1 | MVC Preview - Part 1 - Displaying Data

16 minutes, 41 seconds

#2 | MVC Preview - Part 2 - Editing Data and Making Forms

18 minutes, 38 seconds

#3 | MVC Preview - Part 3 - Advanced Techniques

12 minutes, 56 seconds

#4 | MVC Preview - Part 4 - Testing

23 minutes, 20 seconds

UPDATE: There's only a template for MSTest in the new File | New MVC Project wizard right now because we're reaching out to the big Unit Testing libraries to get them to help create templates. If you have a Unit Testing Library, you can get into the MVC File | New Project dialog by packaging up your templates like this. I'd guess/hope that the installers for the major libraries would just include their templates in their next versions.

imageI'll work with Phil to get all the source to the apps in these videos posted soon. I hope you enjoy them as much as I enjoyed making them.

Note that while the player on the site is Silverlight, you can download versions on the same page in WMV format, as well as ones customized for the Zune, iPod, PSP, and MP4 and 3GP.

One other important new feature on the ASP.NET site is that Videos now accept comments and those comments include RSS feeds. Do feel free to leave comments on this blog, but you can also comment on videos and screencast tutorials all over the ASP.NET site. We all read these comments (including my boss) so your feedback IS paid attention to.

Technorati Tags: ,

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
March 06, 2008 2:51
Yay Scott! Good stuff as always. I need to watch these so I can figure out what's going on...
March 06, 2008 2:59
Interesting, although there's a iPod version of the video on the page...the page won't display in an iPhone or (iPwned). Not sure it would play of a page anyway but I was up to give it a try.
March 06, 2008 3:05
Actually I think it IS working...only the iPhone is seemingly trying to download the whole video (over the EDGE network....yikes) before it even finishes rendering the html. I am simutaneously trying it from my PALM with Windows Mobile 6 on the EVDO network...50mb...I'll post again next month when it's done with the results LOL!
March 06, 2008 3:06
It would appear that the silverlight players doesn't support IE 8 Beta 1 >_<, but good ol' wmv works :)
March 06, 2008 3:08
Great stuff, I'm excited in seeing these :)

March 06, 2008 4:05
Nice! These will give me something to do on the plane ride to Boise Code Camp.
March 06, 2008 4:54
Why not use interfaces for views so controllers become reuseable? All pages have to do is implement a IView.
March 06, 2008 5:27
Cool! These are great!!!
March 06, 2008 5:46
I love scott. Because he did with C# screencast.

March 06, 2008 11:25
It' Great!! and I want to run that demo on my laptop.
Where can I get that sources for video?
March 06, 2008 13:25
This is some great news, Scott.

Is there a way to find out what the news are in ASP.NET MVC Preview 2? It's probably in the videos, but I don't have any earphones at the moment and I'm very curious.
March 06, 2008 13:53
Great videos as ususal Scott!

You couldn't consider removing the video feed of yourself while your showing stuff on the screen that the viewers should watch?

A moving picture in the periphery draws the focus away from what you're showing, and I find it hard to concentrate on what you're discussing. (I usually end up blocking the bottom right corner of my screen with a book or something, which is kind of sad since I sometimes miss text that is shown in that spot)
March 06, 2008 14:04
Jocke - The intent with the video of me is to personalize the video a little (so it's not a disembodied voice over). I remove myself by fading in and out throughout the video. The idea is that if I'm there, I've got something important or significant to say, and if I fade away, it's in order to call focus to the screen. In the first videos I did last month my little window was around about 50% of the time or more. From the feedback I got, folks DID like the PIP but they felt, as you say, that it takes away sometimes, so I pulled it back even more and I'm around about 20% of the time. I'll give it some thought. I wanted to take screencasts in general to a slightly different level, with the goal being to improve the learning experience.
March 06, 2008 16:40
BTW, we have MbUnit templates with ASP.Net MVC support now.
You can grab the latest MbUnit v2 and v3 previews from here:
March 06, 2008 18:23
Great stuff - it's very nice that you decided to go down the route of enabling deployment by simply including the mvc dlls in the bin folder - just makes it so much easier when you don't need to run installs on servers for every new addition to the framework.
March 06, 2008 18:34
Scott, excellent video on the new MVC. I'm really excited about this new technology, but I still can't get over the fact that there is no support for ViewState. Most ASP.NET developers are, I think, used to assigning values to controls in the code-behind, and all that inline C# code is kinda ugly in the view. Are there plans to remedy this? Maybe not an implementation of ViewState, but at the least offer the ability to assign values to controls (textboxes, labels, etc.) in the code-behind.

Otherwise, great series of videos, I do think the technology has promise (and I just can't help but play around with new stuff!), so I'll be following MVC closely up until final release.

March 06, 2008 19:09

Watched the first two videos; so far, so awesome! I'm very impressed by the work you guys are doing on this. Thank you very much for putting in so much time to make sure we all understand this framework.

A couple questions/comments:

1) No named routes? You mentioned 3 options for generating URLs and I didn't see named routing in there anywhere. I'd really like to see this as a feature so we don't have to depend on the controller for our routes.
2) I'd love to see an example of a non-typed ViewPage (one that doesn't inherit from ViewPage<T>) and uses a Bag instead (you mentioned this is possible but didn't show it).
3) Perhaps more attention to RESTful routes/resources would help give developers who have never heard of REST an introduction to a great topic.

Keep up the great work, I'm really enjoying the new framework!

March 06, 2008 19:22
Terrific videos - these and your last release of screencasts make ASP.NET MVC an extremely easy early sell.

Most ASP.NET developers are, I think, used to assigning values to controls in the code-behind, and all that inline C# code is kinda ugly in the view. Are there plans to remedy this?

I took a totally different impression from the videos - the helperclasses, combined with consistent form field naming structure seemed to make the postback soup that we have had to deal with as ASP(.NET) developers for years... melt... restfully.... away.
March 06, 2008 19:43
The doesn't really affect me that much if it's there or not, it just drives my ADD crazy when the video and the voice don't match up, or don't appear to.
March 06, 2008 20:01
I've only watched the first video, but I was wondering why you used inline commands rather than the standard ASP.NET controls (DataRepeater, GridView, etc)?

Wanted to post a comment on the actual video, but seems to be trying their hardest to keep that from happening...
March 06, 2008 22:55
Joe F - Sure, there are named routes. I will do a better, longer routing video as we good closer. Thanks for the ideas on topics.
Hal - That's a totally valid observation and that is what a lot of folks thing when they see Views from different MVC Frameworks.
Darren - Do you have examples?
ScottW - I'm on the comment thing, thanks! As for controls, most of those require ViewState, so they're not appropriate for MVC. I'll do a larger post at some point explaining this stuff in more "philosophical terms." One thing that folks forget is that 90% of devs WON'T or shouldn't use MVC. It's not for every development shop and it's most certainly not for every problem.
March 07, 2008 1:29
Scott, will these HOLs you mentioned in video #3 be available for download, and when?
March 07, 2008 2:16
Scott, I have one minor suggestion for the "talking head" PIP. My dear wife, with her degree in Mass Media, would cringe at the way you're framing your face. You've got your head pretty much dead-center in the frame, which is a big waste of screen space, and, while it provides a groovy view of your home office, it tends to distract a little.

The rule of thumb for framing a face close-up is that you should aim to have the eyes of the speaker 1/4 of the way down the screen from the top.

Beyond that very minor nitpick, I think you've hit on a great formula for presenting this information, and, as usual, the information itself is a goldmine. Thanks!
March 07, 2008 2:18
The rule of thumb for framing a face close-up is that you should aim to have the eyes of the speaker 1/4 of the way down the screen from the top.

Did I say 1/4? I meant 1/3. Usually anywhere between 1/4 and 1/3. Depends on how close-up the shot is.
March 07, 2008 4:26
Scott, am I allowed to post source code for these screencasts on my blog (at least these basic)?
March 07, 2008 6:32
Great series...
It looks like the v2 has really made some great changes

Just wanted to let you know that you do have the best screen casts out there today. Thanks for all the work you put into them.
March 07, 2008 6:38
Great videos Scott! Gotta love bleeding-edge development with supporting screencasts. Just to chime in regarding the PIP on your screencasts - I like it; particularly since you've stepped it back just a tad to ~20%.

In watching MVC RC2 video #3 I duplicated the code for the HandleUnknownAction method and discovered a problem. My expectation would be for as you referred to in the video "MissingMethod" calls to occur - and only that. In fact it is called for more often. For example, try just a default URL (i.e. http://localhost:port) and the method will fire. In your video you tested the actionName for a specific string ('about') - while I understand it was for example purposes it won't work in production.

Any ideas on how to deal with this?
March 07, 2008 12:01
Scott, great videos. I like the smooth zooming in to interesting parts of the code and dialogs. Very professional. I also like the short clips of you speaking in the lower corner, but perhaps the size could be just a bit smaller? All in all, very well done. It's so fun to see "old skool" code for rendering and paging again, the good, simple parts from ASP3 that works so well!
March 07, 2008 18:45
Scott, first of all great vidoes. Pretty in-depth coverage i would say.

Have a question for the {*catchall}. Why have an action that takes a string parameter? Why not have an action that takes a dictionary object as a param?
March 08, 2008 0:07
"One thing that folks forget is that 90% of devs WON'T or shouldn't use MVC. It's not for every development shop and it's most certainly not for every problem."

What would be it's use now that you mention it? Besides keeping MS employees employed.

March 08, 2008 4:27
Great screencast, Scott.

I've been playing around with the December CTP, and I'm looking forward to "getting it on" with this new one.

I love the fact that you can have 100% control over the markup, unlike the traditional ASP.NET WebForms model, which could be kind of a pain.

I've noticed that the helper methods, such as Textbox() and Form() puts some extra space in between attributes, and space between the last attribute end quote char and the ">". I know it's a small thing, but I hope you'll consider making it pretty in a later release.

If I write <sometag someattribute="<%= Some code %>">, I get zero intellisence in the code block. I'm guessing this is an issue with Visual Studio... Will this addressed?
March 08, 2008 9:17
I like the fact that you changed to all black in the 4th screencast to mourn the death of Webform development!

March 08, 2008 9:41
You're killing me JG! The rumors of the death of WebForms have been greatly exaggerated. MVC will be something like 5% of folks on ASP.NET. I seriously doubt WebForms is going anywhere, especially for large LOB apps. Now I have to go do a post on it. ;)

Mads F - That's weird. I suspect the intellisense thread is parsing. Does it ever come back?
March 08, 2008 17:31
No, I've waited and waited... Also, when hitting Ctrl+Space, I get that sound Windows use to tell you that you can't do that.
Intellisense everywhere else is working fine (and fast too).
I have this problem on my computer at home and on the one at work.

Am I the only one experiencing this?
March 08, 2008 19:26
I've been trying to post a comment on the video but it's not going so well. the comments disappear so i assume a moderator need to check them out before they'll appear. But with no message to that effect i posted twice. As you can see something's gone orribly wrong.

The comment i was trying to submit:

Unfortunately, sorry to say, you are incorrect in Part 3 - Advanced Techniques.

InterceptionController does not technically handle unknown actions. It handles every action, because the InterceptionController itself doesn't have any actions).

I would have to suggest the video be corrected. Especially since this is learning material for the masses. I appreciate that this may involve significant effort, so at the very least there should be a health warning attached to the video.

The rest of the series is great. keep up the good work.
March 08, 2008 20:16
Thanks for the great videos.

I particularly liked the simplicity of having a single user control for the form fields in ProductInput.ascx to reuse in both the New and Update views. And wrapping this with the typed Html.Form with Lambda. Begins to show some of the techniques to build out a full app.

My main dilema at the moment is form element ids. To allow inline editing of multiple entities of the same type, the id will have to be of the format eg. Product-{id}-Title, or at least that's the format I often use. It would be almost nice if the HtmlHelpers had a BuildId(htmlName, dataSource) method that you can override. Saves then having to pass in the id as an attribute each time in the View, for each Html.FieldType method call. Or can something like this currently be done?
March 09, 2008 14:03
Great videos. I've watched them all - for me PIP is just fine as it is.

I've got a different concern about MVC - is there any place for some AJAX automation? Or everyone will have to do all the AJAX stuff on his own e.g. using ajax calls to web services.

What I also don't like is mixing the markup with the code (it's a little bit like old ASP isn't it).

I fully agree that this model of MVC would make the application fully controled by the developer what's not always that easy with current ASP.NET model.

I can't wait further news on MVC. Keep up the good work.
March 11, 2008 0:32
How far off is this from an actual release? I've been burned by too many Microsoft Skunkworks projects in the past to get excited. I'm still waiting for ObjectSpaces 1.0!

Give me some confidence in this endeavor Scott...


March 11, 2008 10:40
any idea why 3 of my 4 comments posted about your video have not appeared?

have they been rejected? have they been read? are they being dealt with?

why did the 1 comment that did appear appear? it's basically a "please delete me" comment, if anything it's the only comment that shouldn't be there.

pretty sucky if you ask me.
March 11, 2008 12:58
I'm not familiar with the MVC model yet, a brief introduction to ASP.Net MVC and under what circumstances it will be useful will help (reason for this request is because you spent so much time on routing and I'm not able to find a relation of it with MVC). Thanks
March 14, 2008 1:17
Hello Scott,
I`m a german .NET developer and played with the mvc sample and added a simple membershipbased login system: here is the link to my blogpost (scroll down to [ Download Democode ] - the blogpost is in german, but the application in english) :

You can login, register a new account, get a new password, change userproperties (email and password) and with the admin account you are able to delete other users.

There are a lot of questions in the mvc forum about membership - maybe such a extended mvc demo app would be usefull.

March 20, 2008 17:47
Same quiestion as Andy. We currently have a Java system that I need to convert to .net. For inline editing of multiple objecst of the same type something like 56_Product_... is used where 56 is an id that gets translated into a real record id by the system. (56 mapps to actual id of the record). So my question is if there will be something like this provided by the framework. Oh, yes I forgot, we are jumping into this framework ,and we have project to deliver in 3 months. God help us.
April 04, 2008 5:31

Can someone give me a link to the source code from these screencasts? I have searched high and low on Scott's site but can't find it. It's probably somewhere obvious but it has got me beat.

Thanks in advance
April 14, 2008 19:46

As usual, the way you present and explain your videos always helps me understand the subject better than other videos.

I am really, REALLY interested in MVC and I've been consuming everything I can about it since it's inception. I've got a better understanding of it since watching videos and reading tons of material, but I'm still foggy on a few things. So in the hopes that I would better understand it by doing, I started a web site and hopefully an MVC project that the community can help with. was starting on April 9, 2008. If you know of anyone, including yourself, who would want to be a part of this open source MVC project, please send them to the site. I want to have several team leaders on this since I'm starting with an e-commerce project.

My problem with MVC is wrapping my head around it and sort of unlearning what I've learned with ASP.NET 2.0 and it's developer friendly UI.

Keep up the good work. BTW, when do you sleep?


King Wilder

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.