Scott Hanselman

DevConnections and PNPSummit MVC Demos Source Code

November 9, '07 Comments [23] Posted in ASP.NET | Source Code | Speaking
Sponsored By

110207_2058_AnnouncingT1 Folks are chomping champing at the bits to get their hands on the MVC bits. There will be a CTP very soon, so hang in there and be patient. Bits will come as soon as possible, truly.

Until then, I talked to BradA and got permission to share with you the source code of all the demos that Phil, Chris, myself and others worked on and showed at the two conferences minus all DLLs.

<disclaimer>
To be clear, these demos are demos. They were put together for the talks. You won't be able to compile or run them, and they don't represent anything other than interesting proofs of concept for the purpose of demo'ing. They are useless for anything other than reading. If they kill your flowers, it's no one's fault but your own. Read at your own risk and for your own edification. These demos don't represent the final product, nor do they even represent anything other than being an interesting curiosity. Everything can and will change and likely already has.
</disclaimer>

Here they are:

Enjoy. Also, as an aside, I encourage you to go get the new ".NET Framework 3.5 Commonly Used Types and Namespaces" poster and find a printer large enough to print it out.

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
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Friday, November 09, 2007 9:28:26 AM UTC
So what's the MvcHandler? I see it's configured in a web.config to handle the .mvc extension.
Mike
Friday, November 09, 2007 9:49:47 AM UTC
Also, if you could maybe write a post explaining what you did with the IPostRepository in the BlogEngine example I would really appreciate that.
Mike
Friday, November 09, 2007 1:07:24 PM UTC
Aaagh! Frigging work proxy is blocking the download page. Will have to risk the flowers at home . . .
Friday, November 09, 2007 1:23:11 PM UTC
The BlogEngine sample looks neat. I couldn't open the dbproj, though. Is this specific to VSTS for DB Pros? This is totally the way I want to develop for ASP.net in the future.
Friday, November 09, 2007 1:36:41 PM UTC
So you now leave us with our mouths watering for more...Thanks for providing us with these examples.
Friday, November 09, 2007 1:51:00 PM UTC
Florian,

You have to have Visual Studio Orcas Team Edition for DB Professionals installed. It is included in the Team Suite beta that you can download.

Friday, November 09, 2007 2:34:32 PM UTC
Hey Now Scott,
in the addictive versions of .NET Framework you have Cardspace listed as part of .NET 2.0. I could be wrong but I thought it was part of .NET 3.0. I just got the demos & look forward to trying them starting with the classic hello world.
Hanselminutes Fan,
Catto
Friday, November 09, 2007 3:01:47 PM UTC
The additive thing is a bit misleading if you are just glancing at it. The stuff that is in the same circle as the test ".NET 2.0" isn't the 2.0 stuff, it is 3.0 - the stuff in the circle that it rests on is 2.0

It might be easier to see what I mean by starting at the outside and looking in. (Or, alternatively, rather than make the association positionally you could use the color cue. Each group is color coordinated with the label of that group)
Michael
Friday, November 09, 2007 3:13:32 PM UTC
I looked high and low and can't find a download for the actual MVC framework anywhere. Is it available anywhere or this demo is some kind of a cruel joke?
Alex G
Friday, November 09, 2007 3:14:05 PM UTC
Hey Scott,

I haven't seen any examples of routing information in a config file since ScottGu's ALT.NET presentation; all routing information is always shown in the Global.asax now. Is routing via the simple text config still part of the planned release?
Friday, November 09, 2007 3:18:34 PM UTC
Not to be one of those people, but the phrase is actually "champing" at the bit. I used to get it wrong all the time too.
Friday, November 09, 2007 4:33:22 PM UTC
Do you ever sleep? ;) Blogging at midnight and back at p&p early. Looking forward to today's presentation.
Tom
Friday, November 09, 2007 6:57:43 PM UTC
@Alex G -

Uh, I hope you didn't search too long for the "actual" MVC framework. Or if you did it was at least on Company time ;)

ian
Friday, November 09, 2007 9:20:30 PM UTC
I think this is one of the most anticipated or at least talked about features/products coming out from Microsoft in a very long time. There is more buzz from developers I know who want this more than they want VS2008 or LINQ.

This either says a lot about what the team has done so far with MVC or how much we don't really like WebForms. I have to say the latter for myself but I think it's both for most people.
Friday, November 09, 2007 9:52:23 PM UTC
I'm really excited about the new MVC framework. I'm glad Microsoft is comitted to evolving ASP.NET.

However, at the same time, it's a little frustrating to see the hacks involved in integrating IronPython and IronRuby. I hope the DLR team solves the serialization issue some day so that IronPython and IronRuby can become true first-class .NET citizens.
Friday, November 09, 2007 10:26:54 PM UTC
You're a cruel man Mr Hanselman, very cruel. However thank you for posting these even if it's just a big tease.
Cheers
Friday, November 09, 2007 10:54:14 PM UTC
@Rob Bazinet:

Wow. Really? More than LINQ? LINQ in many ways was a groundbreaking enhancement, I tend to think of MVC framework as an implementation of something pre-existing for ASP.NET and do you really think that most people hate webforms? I admit that the jump from classic ASP to 1.1 (in my case) was a bit nerve racking; but now years alter it's just a different approach to accomplishing a task. While I can agree that viewstate was (maybe still is, I dunno) probably one of the more abused items of the webform model; the page lifecycle was one of the most powerful evolutions in web development in years.

I am all about options. Platforms, IDE's, design concepts, whatever. They're all just different choices for solving a problem that is demanding a solution. So, while the nerd in me instantly downloaded these tantalizing samples as I follow the road to the first community preview; I really think its a cool new "choice". Not necessarily a "better" one.

Then again I am not exposed to the framework already like Scott, Phil, and now Rob Conery are, so what do I know?
ian
Saturday, November 10, 2007 1:09:13 AM UTC
I really hope that the recommended view engine isn't Brail or NVelocity. Those things are a step backwards when it comes to developing views. The problem may be endemic to HTML. Doug Crockford got it right when, in his State of AJAX video on YDN, he lamented that HTML wasn't composable.
Joe Chung
Saturday, November 10, 2007 1:50:49 AM UTC
@Edward - This DLR Examples is is just me screwing around to prove the concept. The support will be first class and I'm working personally to shepherd it through. The DLR Team will work with the MVC Team to make that happen. Don't worry.

@ian - You're right...LINQ is the bomb and is the engine that makes much of this work. C# 3.0 is huge in making this whole thing pretty and easy to write against.

@Joe - The base ViewEngine (Factory) will be WebFormsViewFactory, minus ViewState, ServerSide Forms and PostBacks. You can plug in whatever View system you'd like, including but not limited to Brail or NVelocity.
Saturday, November 10, 2007 7:38:56 PM UTC
@ian - I am not saying MVC is a more distinct feature or a more important feature than LINQ. LINQ certainly has more overall impact on .NET development. My point was only that there seems to be a lot more excitement for MVC than LINQ. The reason may be that LINQ has been talked about for longer and not as much of a surprise as MVC. I think the .NET community was blown away with the announcement.

Webforms are popular but like any technology, has it's good and bad. In my opinion webforms has a bunch of downsides that an MVC framework will help avoid. I am not a huge fan of webforms and am anxious for MVC.

I agree that choice is good and I am all for that as well, each technology has it's place.
Sunday, November 11, 2007 1:17:47 PM UTC
I agree with Rob.

When I have first seen the asp.net I was immediately attracted to it, because of the bunch of built in functionality and similarity to windows platform development. But doing more complex applications I have realized it flaws, especially lately since I have started to use TDD. And since I spend the most of my time programming the UI, I am more excited about MVC than LINQ (although LINQ is also a great technology - good by TableAdapters :-)).
dpirs
Friday, November 16, 2007 9:28:59 AM UTC
Big thanx Scott! That's so much better than Powerpoint slides :-)
Slav
Tuesday, December 04, 2007 10:24:00 AM UTC
There seems to be an error on your page ! below the Dell laptop add on the right bar!!

Error displaying xml file:
The process cannot access the file 'd:\domains\hanselman.com\blog\SiteConfig\local_89718.xml' because it is being used by another process.

mscorlib

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamWriter.CreateFile(String path, Boolean append) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize) at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding) at Hanselman.TextLinkMacro.WriteAllText(String path, String contents, Encoding encoding) at Hanselman.TextLinkMacro.TextLinks(String adID, String inventoryKey)
Fuzze
Comments are closed.

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