Scott Hanselman

Free ASP.NET MVC eBook - NerdDinner.com Walkthrough

March 10, '09 Comments [40] Posted in ASP.NET | ASP.NET MVC | NerdDinner | Source Code
Sponsored By

imageToday is a pretty cool day. It's the culmination of a bunch of little stuff and a lot of hard work by some really nice dudes. Here's a few surprises.

Rob, Phil, and I have been working on the ASP.NET MVC book for a while. One (poorly kept) surprise is the inclusion of ScottGu as an author on the book. Between the four of us, we got enough forehead space for like six guys.

Here's where it gets cool.

Free ASP.NET MVC eBook

Today we're releasing the first 185 pages of the book as a FREE PDF download.

Not only that, it's licensed as Creative Commons Attribution No Derivatives. You can share, distribute, hand out, transmit it all you like. You can even include it in your own book if you'd like. ;)

We worked really hard on this chapter, but the real applause goes to ScottGu who closed down Starbucks a number of times, working late into the night. If you enjoy ScottGu's Epic Blog Posts, here's 185 pages of Epic. This chapter will be Chapter 1 in the book; kind of a book within a book.

The book itself is deep in production but this should hold you off for a while, I hope. ;)

Free ASP.NET MVC Sample Application - NerdDinner

Next, we're releasing the NerdDinner sample application at http://nerddinner.codeplex.com as MS-Pl. It's not nearly as sophisticated as the MVC Storefront, but it's pretty cool and does some nice stuff in a very clean way, in our opinion.

There's also more Full Application Samples to be had at http://www.asp.net/mvc with more to come soon!

Big thanks also to the NerdDinner style designer Michael Dorian Bach and to Dave Ward for his jQuery ninja skills. Thanks also to Steve Harman for his peer review. (I'm getting there! Soon...)

I'll be maintaining the application with all these folks, and you're welcome to join in! I'm hoping to add features like RSS, iCal, Blog Badges, jQuery UI controls, OpenID and more in the coming weeks. Wanna help?

Mix 09

I'll be presenting NerdDinner and the code at Mix 09 next week on Thursday at 2:30pm in session "T49F" called

"File|New -> Company: Creating NerdDinner.com with Microsoft ASP.NET MVC "

You can sign up for my talk by going to the Mix Session Builder, entering "T49F" and clicking on the "Green Plus Sign" next to the title.

Enjoy!

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
Tuesday, March 10, 2009 10:01:43 PM UTC
Nice job guys. Look forward to seeing the book.
James
Tuesday, March 10, 2009 10:06:42 PM UTC
Now THERE'S a collection of fiveheads.
Tuesday, March 10, 2009 10:31:42 PM UTC
Great stuff Scott. Lets hope this is a great way for people - with and without a ASP.NET background to get into the MVC Framework!

See you at Mix! :)
Tuesday, March 10, 2009 10:37:01 PM UTC
Thank you Scott and all of the others for this amazing job :)
Tuesday, March 10, 2009 11:12:21 PM UTC
Thank you Scott, and Phil and Rob and the Gu. I'll be at your MIX presentation next week for sure.
Tuesday, March 10, 2009 11:45:32 PM UTC
Great Job!

Thanks for release this code :)
Wednesday, March 11, 2009 3:07:48 AM UTC
Nice. I'll also be at your demo.
Wednesday, March 11, 2009 3:14:05 AM UTC
Super, I've been looking for a proper way to dig into ASP.NET MVC and this looks like the perfect way. I was thinking of buying this book when it is published, but that's still a number of months off--this will allow me to get a head start!
Wednesday, March 11, 2009 4:02:31 AM UTC
Scott,

Any chance you could put me in touch with a speaker for an MVC talk April 8th (Wed) in Bellingham. 6pm ish. I run the Bellingham .NET UG. INETA member in good standing. Bellingham is about 1.5h north of Redmond/Seattle.

Thanks for any help,

-Andy
Wednesday, March 11, 2009 5:20:46 AM UTC
Thank you scott, phil, the gu, rob, you guys really show the spirit of openness.
ASP.NET MVC is definitely the best thing that has ever come from Microsoft yet.
herry
Wednesday, March 11, 2009 5:29:18 AM UTC
I'm a bit confused - CC No Derivatives says:

You may not alter, transform, or build upon this work.


So wouldn't that prevent people from "includ[ing] it in your own book"?

Just curious. :)
Noah
Wednesday, March 11, 2009 5:40:49 AM UTC
Noah - I voted for the "do whatever" license, but the publisher pushed back. If the chapter was "included" in a book, but the book itself didn't "build upon" the chapter, it's cool, as I read it.

BUT! The code itself is MS-PL, so they can totally build upon the code, just not extend Scott's Chapter. It's sub-optimal, but I'm REALLY trying to push for open-ness at every level. This is a pretty good start, I think...half a book for free.
Wednesday, March 11, 2009 6:11:38 AM UTC
Andy, email me privately?
Wednesday, March 11, 2009 8:26:57 AM UTC
Scott, any chance you can give Michael Dorian Bach a quick note that his site could use a little update?

I didn't spend all day looking for it, but his contact link seems to be missing.
I've been looking for some "public learning journey" like you and Phill happen to have from time to time, but for Silverlight.
It would be interesting to be able to follow Michael's Silverlight road trip, but I couldn't find any way to subscribe to a single post, tag or something like that.
His comments are disabled and his "Don't be a stranger. Say hello." link is just a line of text, not a link.

Thx.

Wednesday, March 11, 2009 9:10:04 AM UTC
Scott, Do you have a standard stock image you use for the front of your books, they're all looking pretty similar.
Joe
Wednesday, March 11, 2009 9:26:11 AM UTC
Joe - Should I get a new photo each time I do a book? I'm still the same dude. Same haircut, same weight, same beard.
Wednesday, March 11, 2009 10:46:23 AM UTC
"Between the four of us, we got enough forehead space for like six guys." -- Big foreheads for big brains! This is the ASP.NET MVC book and project I've been waiting for! Thanks so much, guys!
Joe Chung
Wednesday, March 11, 2009 12:31:23 PM UTC
So cool!

There is something happening in the world of .Net and Microsoft - awsome to get this book the day I'm at home looking after my three-year old. She's building with Lego, so I thought I could build some MVC.

Sadly the MVC software doesn't work. (No web page - no errors - installer reports some errors to the log). I'll read the chapter and pretend - but it would be even nicer if the software worked...

I'm running Vista Professional, VS 2008 Team System and some Sdks and stuff.

Some error log messages that seems to come from the install (the installer reported "Installation Successful"):
[...]file (ModelObjectItemVB_ASPNET.vstemplate). Invalid template element (TemplateID) value (Microsoft.Data.Entity.Design.VSTemplate.ModelObjectItemVB_ASPNET).
[...]file (WebDataService.vstemplate). Unknown attribute (_locID).
[...]file (csWPFBrowserApplication.vstemplate). Unknown element (EnableEditOfLocationField). Parsing will attempt to recover

(Installed only the mvc-download from a page referred from the download page the book pointed to)

Keep up the good work! Looking forward to listen to you at Norwegian Developers Conference again this summer.

Harald.
Wednesday, March 11, 2009 12:41:15 PM UTC
Nice chapter. Better than I expected.
Wednesday, March 11, 2009 12:43:58 PM UTC
Super !!
Jav
Wednesday, March 11, 2009 2:13:13 PM UTC
A "book" about programming. What a cute idea! You could use this to look stuff up if your internets were broken. ;-)
mhenry1384
Wednesday, March 11, 2009 2:15:43 PM UTC
BTW, Scott, your open ID implementation is still screwed up. I get

403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.

When trying to log in using Yahoo. My Yahoo Open ID works fine on stackoverflow.
mhenry1384
Wednesday, March 11, 2009 3:32:59 PM UTC
will there be a Kindle or eBook version of the final book?
chapter looks great!
Wednesday, March 11, 2009 4:18:34 PM UTC
You guys are REAL slackers!!!
You had the chance of being the first Wrox book in history where all authors could actually take a *real* picture together, and you let Wrox do the usual collage thing???

Just get a camera to the cafeteria next time you're together!

:P
Wednesday, March 11, 2009 4:20:43 PM UTC
I've just been skimming through the free download part of the book, so I may be taking something out of context, but on page 88, the code does a try {...} catch {...}, and the intent of the catch is to display a validation error to the user. It assumes the exception was thrown as a result of bad input from the user (as shown on page 89). This isn't meant for production code is it? Doesn't this violate the rule of only catching exceptions that the program expects and can handle? Shouldn't it only be catching specific exceptions, not any exception? For instance, if the connection to the database is down for some reason won't the user keep being re-directed to a validation error even is nothing is wrong with the data?

I'm not trying to nit-pick. I'm was just trying to learn best practices while I make the transition to MVC.
RussellH
Wednesday, March 11, 2009 8:55:52 PM UTC
Thanks for the feebie.
Jeremy
Wednesday, March 11, 2009 10:19:22 PM UTC
Scott,
The ebook is really good.

Going through it today.

This is totally the shot in the arm I needed to dive in.

Thanks

GAJ
pdxJaxon
Thursday, March 12, 2009 6:31:48 AM UTC
Hey Scott,

Is this book up to date with all the functionality in the current MVC RC-2 Build? Or is it based on older code?

Thanks,
-cm
cm
Thursday, March 12, 2009 6:51:24 AM UTC
cm - Yes, this is up to date with what will be the release version.
Thursday, March 12, 2009 7:30:59 AM UTC
Hey Scott,

Firstly, kudos to you guys on showcasing the app.

One thing though, the live site NerdDinner.com did not pass the W3C markup validation test (at http://validator.w3.org/). It would be nice to see this fixed.

~Jason
Thursday, March 12, 2009 3:08:04 PM UTC
Great work Scott, by the way do you know when we could expect first Release version of MVC (not RC)?
Thursday, March 12, 2009 3:14:46 PM UTC
I still don't understand why I should care about asp.net mvc. I see more logic going into the html markup in mvc than web forms - and from what I've seen its highly breakable due to poor compiler support for all the items that are being put in quotes. Will this chapter enlighten me?
Dave T
Friday, March 13, 2009 4:13:34 PM UTC
Hi, Scott!

How can I contact you? 2idi.com registration is not allowed. And I have a message for you.
Friday, March 13, 2009 4:48:12 PM UTC
Look closer...2idi registration isn't needed. Just an email address.
Friday, March 13, 2009 5:43:28 PM UTC
Scott,

Thanks for this. I have just started getting my feet wet with MVC and am really excited with what I see so far. I am working my way through the e-book and have come across something that has got me. On page 81 it talks about adding a ControllerHelper class. Is there somewhere special we need to add this in order for all the Controllers to be able to use it. I wasn't sure how to encapsulate it. Thanks again for the e-book. It has made my friday more enjoyable.

Jared
Friday, March 13, 2009 5:49:14 PM UTC
A little digging and I found the source code. I think I can take it from here. Thanks anyways.
Saturday, March 14, 2009 8:28:39 AM UTC
Applying dependency injection in NerdDinner Application using Unity Application Block
http://weblogs.asp.net/shijuvarghese/archive/2009/03/12/applying-dependency-injection-in-asp-net-mvc-nerddinner-com-application.aspx
Sunday, March 22, 2009 10:26:30 AM UTC
mhenry1384
[quote]A "book" about programming. What a cute idea! You could use this to look stuff up if your internets were broken. ;-)[/quote]

There book has too many incomplete instructions in it [bugs?]. After I'd got about half-way through the tutorial it became increasingly difficult to carry on due to the mismatch between the code I was writing the the code I "should've wrote". I'm new to Ling and Mvc. There are just too many vital instructions missing from the tutorial. Providing so many detailed screen-shots has give you a false sense of security. You need to provide detailed errata which is updated with the missing information. In the manner that the old Wrox books used to have.

I'm not nit-picking - the book has serious problems with it and I doubt 90% of developers could easily complete the project by just following the book. After I'd got halfway through I was frequently reduced to using WinMerge to compare my version against the code-download version. Even doing that it's not easy to figure out (a) what needs to be added/changed to the current version of my project; (b) what needs to be added in later steps and (c) what is not essentil to get the project working.

It may have been more sensible to release this as a preview under the "Wrox First" or "Wrox Blox" series - then the book would've had an entry on the Wrox site and someone would've been given the responsibility of writing the errata.

Errata list please.

PS: I spent years of my life writing tutorials like this as I used to be an professional educator. So I know just how easily students get stuck and just how verbose an author needs to be.

Despite all that nit-picking. Thanks for the book.
Friday, April 10, 2009 10:40:51 PM UTC
Hiya Scott,

A comment and a question, if you will.

It might be good to add an instruction to the NerdDinner .pdf indicating the user add 'using System.Text.RegularExpressions;' to Dinner.cs. (Page 40/186). Not something people will normally trip over, but given the detail you're using in the writing, that may help.

As to the question: USA, UK and NL regex strings... interesting. As I am from NL: why this country? :)

Thanks!
Tobias
Monday, April 27, 2009 6:43:00 AM UTC
Hello;
You have done a great work too;
I'd like to congratulate you.
I'm waiting for more work.
Comments are closed.

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