« T4 (Text Template Transformation Toolkit... | Main | Microsoft Web Application Installer - Op... »

ASP.NET MVC is now officially in Beta. Go get it! ScottGu has all the juicy details in his usually Epic style. In a nutshell, this is called Beta (and not Preview 1138) because the quality and the amount of testing gone into it was higher than the Previews and source drops you may have gotten off of CodePlex. It's API surface is pretty stable now.

Also, we're shipping jQuery with ASP.NET MVC! When you go File | New ASP.NET MVC Project, you've already got jQuery. Bam.

Here's what's new in ASP.NET MVC Beta:

If you've been playing it safe as all the Alpha Geeks have been living on the edge, if you're wondering when would be the time to start using ASP.NET MVC or when you could go live, this is a good time to start. This release as a very clear Go-Live license. Totally, (if you haven't already) go out there and put your sites out in public on ASP.NET MVC if you like. It's pretty much feature complete (again, hence, "Beta") and shouldn't change in any major ways between now and it's release in a coming month ending in "-ber" like January-ber or Next June-ber. (Seriously, I have no idea when it'll be out. When it's done. But, we're closer than we were yesterday. Go ask Phil.)

One of the new additions is Model Binders that formalize the relationship between what's happening in HTTP and what ends up happening in your Controller actions. Similar to what you can do in MonoRail with IParameterBinder, you can now do in ASP.NET MVC. For example, back in June I showed how to handle uploaded files with ASP.NET MVC. It was useful, but hard to test and kind of hard to read.

Here's a cleaner way as an example from Levi Broderick, a Developer on the ASP.NET MVC team.

A Sample ModelBinder for HttpPostedFileBase:

public class HttpPostedFileBaseModelBinder : IModelBinder {
public ModelBinderResult BindModel(ModelBindingContext bindingContext) {
HttpPostedFileBase theFile = bindingContext.HttpContext.Request.Files[bindingContext.ModelName];
return new ModelBinderResult(theFile);
}
}

You'd activate it in your global.asax.cs (or .vb):

ModelBinders.Binders[typeof(HttpPostedFileBase)] = new HttpPostedFileBaseModelBinder();

Then you'd make sure the form in your view uses the correct enctype:


Choose file:

…and finally, in the action method of your controller:

public ActionResult Upload(HttpPostedFileBase theFile) {
// 'theFile' now contains the uploaded file
}

That's it. There's lots of cool binding stuff you can do, but that's just one example.

One other thing I wanted to say. I was in Las Vegas yesterday keynoting VSLive and I made it a point to show this new slide. It's simple, and perhaps obvious, but perhaps not:

image

I wanted to make it clear that even though folks (and me) might use the term "hybrid" to refer to ASP.NET applications that mix WebForms, MVC and Dynamic Data, that these are all just ASP.NET. Arguably ASP.NET Ajax and the Ajax Controls could be either another circle or part of the larger one.

I also showed ASP.NET+Dynamic Data that you'll be hearing more about at PDC and even more next year. You should feel free to use these subsystems as you like, mix and match, promote and ignore. Whatever makes you happy. All the ASP.NET core stuff like Authentication, Authorization, Session, Caching, etc, that all works in all of these subsystems because they are all ASP.NET.

Wow, that kind of sounded like a political speech! "Can't we all just get along? MVC and WebForms living together, with Dynamic Data by their side..."

Enjoy.



Thursday, October 16, 2008 3:06:34 PM (Pacific Standard Time, UTC-08:00)
Great news... just as my posts on writing a RESTful web service using MVC was getting to usng different verbs you fix the issue I had just stumbled on... two methods with the same name only distinguished by the AcceptVerbs attribute throws an exception. So rather than work round it in Preview 5, I can just download the beta :-)

Only downside is going back over those previous posts to make the code compile with the Beta :-(
Thursday, October 16, 2008 4:28:50 PM (Pacific Standard Time, UTC-08:00)
Nice Job.
Thursday, October 16, 2008 6:08:51 PM (Pacific Standard Time, UTC-08:00)
Absolutely great news!
I've been designing and prototyping a new (pretty large) application lately with MVC and was wondering what the status may end up being when we actually release.

Guess the Beta is now somewhat feature-stabilized?

greetings Daniel
Thursday, October 16, 2008 6:28:24 PM (Pacific Standard Time, UTC-08:00)
Scotty ,
I have already designed a solution around preview 5 and this is a gr8 news. fly high scott
balaji
Friday, October 17, 2008 5:25:29 AM (Pacific Standard Time, UTC-08:00)
Fantastic,

I love the MVC, I always thought the postback cycle was kludgy. It's been great to watch this Framework progress through CTP.

Friday, October 17, 2008 6:34:05 AM (Pacific Standard Time, UTC-08:00)
Keep pushing that message Scott :)

Seriously, I gave a talk a year ago on Monorail, and one of the keys was to note that Monorail sits on the asp.net 'pipeline', and after that I was clear to always say "asp.net webforms" and "asp.net monorail" - for me personally, I see the Webforms as a ViewEngine (I know it's more than that really). The more I studied the underlying asp.net engine, the more I appreciated it's design. It allows for a page controller or front controller approach - which is brilliant, as well as it's clean separation from the core 'http' stuff from the framework that sits on top of it (HttpContext, HttpRequest/HttpResponse)

So, with asp.net mvc, it's important to realize that it sits on top of the same underlying asp.net engine as webforms.

I'm glad to see the 'hybrid' approach - this will allow me, someone who has quickly adopted to mvc to have some options if I'm working in a webform environment.

Thanks again - and keep spreading the message!
Thursday, October 23, 2008 1:04:02 AM (Pacific Standard Time, UTC-08:00)
Similar to what you can do in MonoRail with IParameterBinder, you can now do in ASP.NET MVC
Yeah, ASP.NET MVC is almost as cool as MonoRail ;)

The more I studied the underlying asp.net engine, the more I appreciated it's design.
ASP.NET is truly a work of art, with great design and endless extension points. I think that MonoRail and ASP.NET MVC both serve as a proof for that.


Though Im super comfy with MonoRail (having lots of experience with it, and being a committer for Castle) I am also liking ASP.NET MVC a lot, for the way it adhere to the same ideas - of simplicity and extensibility.

Monday, November 03, 2008 8:11:21 AM (Pacific Standard Time, UTC-08:00)
Why in the world would anyone use a mixed MVC with classic ASP.NET
Dave Schinkel
Monday, November 03, 2008 8:16:17 AM (Pacific Standard Time, UTC-08:00)
to clarify, I hope people are not using the hybrid approach as an overall strategy other than slowly moving to mvc. Otherwise, makes no sense to mix standard (classic) asp.net with MVC asp.net
Dave Schinkel
Friday, November 14, 2008 4:51:59 AM (Pacific Standard Time, UTC-08:00)
Scott,
What fo you think, is ASP.NET MVC ready for production usage or it would be better to wait release?
Friday, November 14, 2008 9:33:58 AM (Pacific Standard Time, UTC-08:00)
Fedorov - I think that I'd go live with what we have, but if you're not comfortable, you should totally start coding your project now with the Beta.
Comments are closed.

Contact

Sponsors

Hosting By

Hot Topics

Tags

Calendar

<November 2009>
SunMonTueWedThuFriSat
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

Archives

November, 2009 (5)
October, 2009 (19)
September, 2009 (11)
August, 2009 (12)
July, 2009 (21)
June, 2009 (26)
May, 2009 (16)
April, 2009 (13)
March, 2009 (17)
February, 2009 (17)
January, 2009 (18)
December, 2008 (32)
November, 2008 (17)
October, 2008 (22)
September, 2008 (16)
August, 2008 (14)
July, 2008 (25)
June, 2008 (19)
May, 2008 (17)
April, 2008 (17)
March, 2008 (26)
February, 2008 (21)
January, 2008 (28)
December, 2007 (19)
November, 2007 (17)
October, 2007 (31)
September, 2007 (39)
August, 2007 (37)
July, 2007 (43)
June, 2007 (37)
May, 2007 (32)
April, 2007 (38)
March, 2007 (29)
February, 2007 (46)
January, 2007 (31)
December, 2006 (27)
November, 2006 (31)
October, 2006 (32)
September, 2006 (39)
August, 2006 (34)
July, 2006 (40)
June, 2006 (18)
May, 2006 (31)
April, 2006 (34)
March, 2006 (30)
February, 2006 (38)
January, 2006 (44)
December, 2005 (19)
November, 2005 (34)
October, 2005 (24)
September, 2005 (37)
August, 2005 (20)
July, 2005 (24)
June, 2005 (33)
May, 2005 (16)
April, 2005 (22)
March, 2005 (34)
February, 2005 (15)
January, 2005 (37)
December, 2004 (28)
November, 2004 (30)
October, 2004 (34)
September, 2004 (22)
August, 2004 (34)
July, 2004 (18)
June, 2004 (64)
May, 2004 (49)
April, 2004 (21)
March, 2004 (29)
February, 2004 (29)
January, 2004 (36)
December, 2003 (25)
November, 2003 (24)
October, 2003 (59)
September, 2003 (42)
August, 2003 (24)
July, 2003 (44)
June, 2003 (29)
May, 2003 (21)
April, 2003 (30)
March, 2003 (27)
February, 2003 (47)
January, 2003 (50)
December, 2002 (31)
November, 2002 (38)
October, 2002 (44)
September, 2002 (15)
May, 2002 (2)
April, 2002 (4)

Google Ads