Scott Hanselman

ASP.NET MVC Preview 2 Screencast Tutorials

March 5, '08 Comments [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 http://www.asp.net/mvc 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 http://www.asp.net 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. I am a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Wednesday, March 05, 2008 10:51:32 PM UTC
Yay Scott! Good stuff as always. I need to watch these so I can figure out what's going on...
Wednesday, March 05, 2008 10:59:33 PM UTC
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.
Ryan Smith
Wednesday, March 05, 2008 11:05:11 PM UTC
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!
Ryan Smith
Wednesday, March 05, 2008 11:06:31 PM UTC
It would appear that the silverlight players doesn't support IE 8 Beta 1 >_<, but good ol' wmv works :)
Darren Kopp
Wednesday, March 05, 2008 11:08:57 PM UTC
Great stuff, I'm excited in seeing these :)

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

dave
Thursday, March 06, 2008 7:25:52 AM UTC
It' Great!! and I want to run that demo on my laptop.
Where can I get that sources for video?
Thursday, March 06, 2008 9:25:46 AM UTC
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.
LiQ
Thursday, March 06, 2008 9:53:57 AM UTC
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)
Jocke
Thursday, March 06, 2008 10:04:50 AM UTC
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.
Thursday, March 06, 2008 12:40:22 PM UTC
BTW, we have MbUnit templates with ASP.Net MVC support now.
You can grab the latest MbUnit v2 and v3 previews from here: http://code.google.com/p/mb-unit/
Thursday, March 06, 2008 2:23:57 PM UTC
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.
Thursday, March 06, 2008 2:34:34 PM UTC
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.

James
Thursday, March 06, 2008 3:09:11 PM UTC
Scott,

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!

-Joe
Thursday, March 06, 2008 3:22:16 PM UTC
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.
Thursday, March 06, 2008 3:43:52 PM UTC
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.
Darren Kopp
Thursday, March 06, 2008 4:01:49 PM UTC
I've only watched the first video, but I was wondering why you used inline asp.net commands rather than the standard ASP.NET controls (DataRepeater, GridView, etc)?

Wanted to post a comment on the actual video, but asp.net seems to be trying their hardest to keep that from happening...
Thursday, March 06, 2008 6:55:46 PM UTC
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.
Thursday, March 06, 2008 9:29:40 PM UTC
Scott, will these HOLs you mentioned in video #3 be available for download, and when?
Thursday, March 06, 2008 10:16:30 PM UTC
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!
Thursday, March 06, 2008 10:18:00 PM UTC
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.
Friday, March 07, 2008 12:26:46 AM UTC
Scott, am I allowed to post source code for these screencasts on my blog (at least these basic)?
Friday, March 07, 2008 2:32:30 AM UTC
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.
Mike Meisinger
Friday, March 07, 2008 2:38:11 AM UTC
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?
Friday, March 07, 2008 8:01:15 AM UTC
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!
Friday, March 07, 2008 2:45:55 PM UTC
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?
Jitesh Patil
Friday, March 07, 2008 8:07:11 PM UTC
"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.

:]
John A Davis
Saturday, March 08, 2008 12:27:53 AM UTC
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?
Mads F
Saturday, March 08, 2008 5:17:15 AM UTC
I like the fact that you changed to all black in the 4th screencast to mourn the death of Webform development!

;)
Saturday, March 08, 2008 5:41:40 AM UTC
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?
Saturday, March 08, 2008 1:31:33 PM UTC
Scott:
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?
Mads F
Saturday, March 08, 2008 3:26:39 PM UTC
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.

http://forums.asp.net/t/1229582.aspx

The rest of the series is great. keep up the good work.
tgmdbm
Saturday, March 08, 2008 4:16:14 PM UTC
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?
Andy
Sunday, March 09, 2008 10:03:22 AM UTC
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.
Wojtek
Monday, March 10, 2008 8:32:00 PM UTC
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...


;-)



Eric
Tuesday, March 11, 2008 6:40:53 AM UTC
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.
tgmdbm
Tuesday, March 11, 2008 8:58:53 AM UTC
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
Reva
Thursday, March 13, 2008 9:17:12 PM UTC
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) :
http://code-inside.de/blog/2008/03/13/aspnet-mvc-preview-2-membership/

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 asp.net mvc forum about membership - maybe such a extended mvc demo app would be usefull.



Thursday, March 20, 2008 1:47:43 PM UTC
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.
Ed
Friday, April 04, 2008 1:31:34 AM UTC
Hi,

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
Monday, April 14, 2008 3:46:34 PM UTC
Scott,

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.

http://www.mvcstarterkits.net 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?

Thanks,

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.