ASP.NET MVC 2

[In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu]

Over the last six months the ASP.NET team has been steadily releasing preview, then beta, and now release candidate builds of ASP.NET MVC 2.

Given that the final release is not too far away, I thought it was a good time to start a new multi-part ASP.NET MVC 2 blog series that discusses the new features and how best to take advantage of them.

ASP.NET MVC 2

We shipped ASP.NET MVC 1.0 last March.  Since then, almost 1 million developers have downloaded and used the final release, and its popularity has steadily grown month over month.

ASP.NET MVC 2 is the next significant update of ASP.NET MVC. It is a compatible update to ASP.NET MVC 1 – so all the knowledge, skills, code, and extensions you already have with ASP.NET MVC continue to work and apply going forward. Like the first release, we are also shipping the source code for ASP.NET MVC 2 under an OSI-compliant open-source license.

ASP.NET MVC 2 Features

ASP.NET MVC 2 adds a bunch of new capabilities and features.  I’ll cover them in a lot more depth with this blog series.  Some of them include:

  • New Strongly Typed HTML Helpers (posted: Jan 10th, 2010)
  • Enhanced Model Validation support across both server and client (posted: Jan 15th, 2010) 
  • Auto-Scaffold UI Helpers with Template Customization (post coming soon)
  • Support for partitioning large applications into “Areas” (post coming soon)
  • Asynchronous Controllers support (post coming soon)
  • Support for rendering sub-sections of a page/site using Html.RenderAction (post coming soon)
  • Lots of new helper functions, utilities, and API enhancements (post coming soon)
  • Improved Visual Studio tooling support (post coming soon)

How to download ASP.NET MVC 2

ASP.NET MVC 2 is designed to work with both VS 2008 / .NET 3.5, as well as with VS 2010 / .NET 4.  Supporting both versions means that you can start using it today without having to wait to upgrade to VS2010 / .NET 4.

Click here to download the ASP.NET MVC 2 release candidate for .NET 3.5 and VS 2008.  It can be installed side-by-side with ASP.NET MVC 1.0 on the same machine.

ASP.NET MVC 2 is a built-in component of VS 2010 / .NET 4 – which means you will not have to download or install anything to get it once you install any version of Visual Studio 2010.  The current public VS 2010 Beta 2 release includes the ASP.NET MVC 2 Preview 2 release.  The upcoming VS 2010 Release Candidate that will be available for download next month will have a more recent ASP.NET MVC 2 RC built-in.

ASP.NET Web Forms + ASP.NET MVC

We are always careful to make clear that ASP.NET MVC is an option with ASP.NET.  ASP.NET Web Forms continues to be the most widely used approach when building applications with ASP.NET, and the new ASP.NET 4 release contains significant improvements for ASP.NET Web Forms development (clean client IDs and CSS based control markup, better viewstate management, new data and charting controls, URL routing, SEO improvements, and much more).  You can learn more about these improvements within my ongoing VS 2010 and .NET 4 blog series.

We’ll be improving and enhancing both the ASP.NET Web Forms and ASP.NET MVC programming models even further in future releases. Developers can and should choose to use whichever model feels most comfortable and natural to them. We’ll be publishing new videos and guidance on the www.asp.net shortly that helps provide additional guidance about each and how to pick the one that feels most comfortable to you. 

Hope this helps,

Scott

Published Sunday, January 10, 2010 8:54 PM by ScottGu

Comments

# re: ASP.NET MVC 2

Monday, January 11, 2010 2:10 AM by TaoYang

Great,I can't wait to use it!

# re: ASP.NET MVC 2

Monday, January 11, 2010 4:10 AM by Deep

Dear Scott,

It will be great if you can highlight pros and cons of both the programming models.  After lot of reading on Internet, we started one project, last month, using MVC 2 [Beta 2 and then upgraded to RC].  Its quite a steep learning curve [esp since we were new to LINQ and Entity as well] and till now we are facing lot of issues like:

Handling Joins [It just says Object Required, not sure error is in app or in database, though the query runs fine directly in db]

Validation in case of Forms/Classes having more than one tables

Another reason of having such tough time is our client wants mySQL and most of the samples are with SQL Server.

I hope things will work out good soon, as we are already running behind schedule.

Regards,

Deep

# re: ASP.NET MVC 2

Monday, January 11, 2010 4:51 AM by Andrei Rinea

Eagerly awaiting "Enhanced Model Validation support across both server and client" :)

# re: ASP.NET MVC 2

Monday, January 11, 2010 5:05 AM by RichB

The duality (and lack of prescriptive guidance) of MVC vs WebForms reminds me of the "lifestyle" choice of VB.Net or C# back in 2000.

# re: ASP.NET MVC 2

Monday, January 11, 2010 7:41 AM by Lukasz

Looking forward to the posts.

ASP.NET MVC 2 looks pretty cool :)

# re: ASP.NET MVC 2

Monday, January 11, 2010 10:01 AM by Teme

Great!!!

Lot of cool stuff with ASP.NET MVC 2. We already started using it on the Beta because of the Model binder support for validation with DataAnnotation.

I think it will be huge help to the community if we start building sample demo applications that use both ASP.NET MVC and traditional ASP.NET web forms in a hybrid manner.

Teme

# re: ASP.NET MVC 2

Monday, January 11, 2010 11:24 AM by Syed Murtaza Hussain Rizvi

Cool.... i have re-started working on web applications just because of this framework... i love it .....

# re: ASP.NET MVC 2

Monday, January 11, 2010 11:36 AM by Scott Prugh

Will Dynamic Data be ported to support ASP.Net MVC?  

# re: ASP.NET MVC 2

Monday, January 11, 2010 12:54 PM by ScottGu

@Gregg,

>>>>> ASP.NET MVC can be installed and using on Windows XP.  I'll follow up on the training kit to try and understand why that has an issue.

Thanks,

Scott

# re: ASP.NET MVC 2

Monday, January 11, 2010 12:56 PM by ScottGu

@Teme,

>>>>>>> I think it will be huge help to the community if we start building sample demo applications that use both ASP.NET MVC and traditional ASP.NET web forms in a hybrid manner.

I agree - we are going to hopefully have some samples that demonstrate mixed applications as well.

Hope this helps,

Scott

# re: ASP.NET MVC 2

Monday, January 11, 2010 12:57 PM by ScottGu

@Scott,

>>>>>>> Will Dynamic Data be ported to support ASP.Net MVC?

You'll see how many of the dynamic data concepts are integrated with ASP.NET MVC 2 with my next two posts.  The way things work is slightly different - but the way you build models, add validation, and specify UIHints is the same.  Stay tuned for more details - I think you'll like what you see.

Hope this helps,

Scott

# re: ASP.NET MVC 2

Monday, January 11, 2010 2:16 PM by Gregg

Scott, just so there's no confusion...

ASP.NET MVC 2 RC installer ran fine on XP. It's just that the Release Candidate's download page didn't include XP as a supported OS.

As for the training kit, I couldn't install the first example due to the Vista requirement (not sure why since the kit's download page stated that XP was supported) but I'm following along with the documentation without a problem and that's good enough for me.

Thanks!

# re: ASP.NET MVC 2

Monday, January 11, 2010 2:28 PM by rickj1

Great stuff what started as a hobby for me has turned into a mission I'm studying MCTS 70-562

my new years resolution is the be making a living as a developer by the end of the year. I've been following MVC, Silverlight and ASP.NET books, blogs and tutorials There are for obvious reasons more resources for ASP.NET I bounce back and forth trying to learn all of them I can see  if you could tie all three together we would have the best of all three worlds

You guys are hard to keep up with

If an absolute beginner like me can make the move off the resources available an experienced developer should be able to advance rapidly. Please keep the walkthroughs and sample apps coming.

The exciting part for me is this will always be a steep learning curve and a challenge it will never get old keep up the good work don't slow down for a minute it's up to the rest of us to catch up. the reward for me is when a dream becomes a reality but the that is what this business is all about

Thanks again

# re: ASP.NET MVC 2

Monday, January 11, 2010 4:55 PM by DioNNiS

Very useful information! Thank you very much!

# re: ASP.NET MVC 2

Monday, January 11, 2010 9:41 PM by lenocin

I've read your blog post and like others also thrilled about the new version coming.

But in reality:  Starting an Asp.Net MVC project that will be completed (or should I say *must*) in the next say, 6 months, after a long period of planing and design, and huge amounts of investment.

Should we go with 2008 / MVC 1 or 2010 / MVC 2?

# re: ASP.NET MVC 2

Monday, January 11, 2010 11:04 PM by feng

Is there any plan to support Website project type? As Web Application project type is not up to our enterprise application standard.

# re: ASP.NET MVC 2

Monday, January 11, 2010 11:33 PM by Sambo

Great! I love ASP.NET MVC

# re: ASP.NET MVC 2

Tuesday, January 12, 2010 2:15 AM by ScottGu

@lenocin,

>>>>>> Should we go with 2008 / MVC 1 or 2010 / MVC 2?

I would go with ASP.NET MVC 2 for a new project.  The final release of it for VS2008 will be in a few weeks.  The VS10 version will then ship a few weeks after that.

Hope this helps,

Scott

# re: ASP.NET MVC 2

Tuesday, January 12, 2010 2:17 AM by ScottGu

@feng,

>>>>>>>>> Is there any plan to support Website project type? As Web Application project type is not up to our enterprise application standard.

Right now we don't have plans to add tooling support for ASP.NET MVC 2 with web-site projects.  We find that MVC projects tend to work best with web application projects.

Hope this helps,

Scott

# re: ASP.NET MVC 2

Tuesday, January 12, 2010 12:23 PM by toncij

I'm in a dilema:

1: to go with VS2008 MVC2 RC

or

2: to go with VS2010 MVC2 Preview 2

---

I would love to be able to use VS2010 right away because of C# new stuff and EFv4.

@Scott what would you recommend for a new project?

# re: ASP.NET MVC 2

Wednesday, January 13, 2010 11:47 PM by lenocin

Also very interested in your thoughts on toncij's question.

Going with 2008 / MVC 1 for new projects now, is the safest.  But then you end up with a project to be upgraded in a few months(?) should you be inclined to use the latest technologies on the final product.

Going with 2010 / MVC 2 for new projects feels a bit risky right now. (It seems)

# re: ASP.NET MVC 2

Wednesday, January 13, 2010 11:48 PM by lenocin

Please ignore my last comment. Failed to notice you already answered my question!  Sorry.

# re: ASP.NET MVC 2

Thursday, January 14, 2010 11:14 AM by blovett

Scott,

From your reply to Gregg's post (relating to the Sample App and XP), have you found anything more?  I looked at the Dependencies.xml file in the setup directory and it only has entries for Vista and Vista;Server.

# re: ASP.NET MVC 2

Friday, January 15, 2010 4:05 AM by david

Are you planning to change the licence to MSPL (as done in MVC1) so that it can be used e.x. in mono?

# re: ASP.NET MVC 2

Saturday, January 16, 2010 5:41 AM by nithin mohan t k

that's a nice Article Scott. Thanks for all your posts that helps me a lot..

# re: ASP.NET MVC 2

Friday, January 22, 2010 11:15 PM by lanceruch

How come I did not study right away this ASP.NET now I find the development so fast that I am log behind

# re: ASP.NET MVC 2

Monday, January 25, 2010 10:20 PM by renantech

it really help on my blogengine sites.

# re: ASP.NET MVC 2

Tuesday, January 26, 2010 1:55 AM by Majid Shahabfar

Scott,

Should we get ready to migrate from ASP.NET WebForms to MVC?

# re: ASP.NET MVC 2

Wednesday, January 27, 2010 11:25 PM by Sean Iannuzzi

I would check under the Project section versus the Web Project section from the menu.  It may appear as though MVC was not installed, but if you create a new project instead of a web project it will be listed.

# re: ASP.NET MVC 2

Wednesday, February 3, 2010 1:10 AM by Cooper88

I've been reading about MVC and Dynamic data for some time. But I can't get the right information to be informed. I've been programming for about 6 years and want to move into the advance stages. I also run about 40 mini apps and would like to rapid develop all of them at once.

If I want to become a better programmer and reprogram all these apps should I start migrating to MVC, Dynamic Data ( getting less exposure on asp.net but I'm told this is the best to build applications fast) or stick with Web Forms and linq?

I'm confused on what MS technology to concentrate on.

# re: ASP.NET MVC 2

Sunday, February 7, 2010 11:36 AM by John P. Grieb

I love MVC 2 and have used it to develop a Web Application that I've published on the Internet.

I've been careful to use Models to encapsulate my date and have the controllers pass the models to the views. One question I have is what is the best way to implement my hit counter. It's displayed by the master page that all views use. Should I create a model that gets the current hit count from the DB and passes it to every view? That seems like a lot of overhead.

Looking forward to hearing your thoughts,

John P. Grieb

J_Grieb@hotmail.com

# re: ASP.NET MVC 2

Wednesday, February 24, 2010 12:06 AM by Mr tired and dont want to get fired.....so no name.

MVC 2! - just growing tired of it all.  I would just like to get the application coded and go home.  It gets tuff when managment asks to create a mission critical web application in ASP.Net with vb.net, no wait Java, no wait asp.net with c#, AJAX, JQuery, XML, no wait MVC - because its something new they read.  - But they actually never coded with themselves - its all the same right? and assume it can be done in 4 weeks.  I was happy with ASP.Net framwork 3.5 - get it done - no defects -go home.  The user does not care either what it was made with!

# re: ASP.NET MVC 2

Thursday, March 4, 2010 2:32 PM by Rolle

Yeah, sure, but I also go to work to learn something new, to improve the technology and to have fun! I don't do it only for the management. If what you wrote is true, why are you not still working with asp? Or .Net 1.1? Etc... There will ALWAYS be something new, you can't stop that. And nobody is forcing you to use MVC etc, your management isn't the IT pros, are they? YOU are! (hopefully) So you can still just "code and go home", but it might be that your management wants more and you need to find a more "quites and calm" workspace where nothing changes...maybe learn some Cobol? ;o)

# re: ASP.NET MVC 2

Monday, March 8, 2010 9:30 AM by Churl

Rolle, in fairness to "Mr. Tired", learning a new technology with no deadline is an entirely different (and much more fun)than being forced to learn it while implementing a real work assignment on a tight schedule.  Certainly we all need to keep our skills current, but being told to do new work using an unfamiliar technology with no time to learn it properly is a bad situation to be in.  In his case, it sounds as though management is being unreasonable -- as usual.