ASP.NET MVC Release Candidate

At long last I am happy, relieved, excited to announce the release candidate for ASP.NET MVC. Feel free to go download it now. I’ll wait right here patiently.

There have been a lot of improvements made since the Beta release so be sure to read the release notes. I’ve tried very hard to be thorough in the notes so do let me know if anything is lacking. We are also pushing new tutorials up to the ASP.NET MVC Website as I write this.

Also, don’t miss ScottGu’s usual epic blog post describing the many improvements. There’s also a post on the Web Tools team blog covering tooling aspects of this release in detail. As I mentioned when we released the Beta, we didn’t have plans for many new features in the runtime, but we did have a lot of tooling improvements to add. I’ve already described some of these changes in a previous blog post, as did ScottGu in his detailed look.

Our goal with this release was to fix all outstanding bugs which we felt were real showstoppers and try to address specific customer concerns. We worked hard to add a bit of spit and polish to this release.

Unfortunately, a few minor bugs did crop up at the last second, but we decided we could continue with this RC and fix the bugs afterwards as the impact appear to be relatively small and they all have workarounds. I wrote about one particular bug so that you’re aware of it.

For now, I want to share a few highlights. This is not an exhaustive list at all. For that, check out Scott’s post and the release notes.

Ajax

Yes, I do know that jQuery released a new version (1.3.1), and no, it is not in this release. :) We just didn’t have time to include it due to the timing of its release. However, we are performing due diligence right now and plan to include it with the RTM.

We did make some changes to our Ajax helpers to recognize the standard X-Requested-With HTTP header used by the major JavaScript libraries such as Prototype.js, jQuery, and Dojo. Thus the IsMvcAjaxRequest method was renamed to IsAjaxRequest and looks for this header rather than our custom one.

ControllerContext

ControllerContext no longer inherits from RequestContext, which will improve testing and extensibility scenarios. We would have liked to make changes to RequestContext, but it was introduced as part of the .NET Framework in ASP.NET 3.5 SP1. Thus we can’t change it in our out-of-band release.

Anti Forgery Helpers

These helpers were previously released in our “futures” assembly, but we’ve fixed a few bugs and moved them into the core ASP.NET MVC assembly.

These are helpers which help mitigate Cross-Site Request Forgery (CSRF) attacks. For a great description of these helpers, check out Steve Sanderson’s blog post on the topic.

MVC Futures

I added a couple of expression based helpers to the ASP.NET MVC futures assembly, Microsoft.Web.Mvc.dll. These are just samples to demonstrate how one could write such helpers. I’ll add a few more by the time we ship the RTM. Note, if you’re using the old futures assembly, it won’t work with the new RC. You’ll need to update to the new Futures assembly.

In case you missed it the first time, click here for the Download.

Technorati Tags:

What others have said

Requesting Gravatar... Mads Kristensen Jan 27, 2009 5:17 AM
# re: ASP.NET MVC Release Candidate
The news I've been waiting for for a long time. Thanks. Now I can finally start converting some of my sites to the MVC framework. I wanted to wait for the RC so I didn't have to rewrite too much when the final release shipped.
Requesting Gravatar... Chad Moran Jan 27, 2009 5:34 AM
# re: ASP.NET MVC Release Candidate
Thanks for your guys' hard work, love it!
Requesting Gravatar... huey Jan 27, 2009 5:41 AM
# re: ASP.NET MVC Release Candidate
Thanks to the ASP.NET MVC team for so much community interaction. It is a great project.
Requesting Gravatar... Arturo Jan 27, 2009 6:30 AM
# re: ASP.NET MVC Release Candidate
Thank you very much!!!

Muchas gracias!!!

Requesting Gravatar... Duncan Goodall Jan 27, 2009 6:40 AM
# re: ASP.NET MVC Release Candidate
awesome work, well done asp.net team. I'm sure you guys are so happy that MVC has finally made release candidate.

I think you made the right decision go ahead, I know you guys will document any issues and the fixes. Look forward to more.



Requesting Gravatar... Simone Jan 27, 2009 6:41 AM
# re: ASP.NET MVC Release Candidate
Awesome... this is the news I've been waiting for since a few weeks :)
Simo
Requesting Gravatar... q Jan 27, 2009 6:54 AM
# re: ASP.NET MVC Release Candidate
we got mvc!
we got mvc!!
we got mvc!!!
Thanks Phil
Requesting Gravatar... Phil C Jan 27, 2009 7:06 AM
# re: ASP.NET MVC Release Candidate
WOOOOO HOOOOOOO!

This is a most excellent day!

To the download, Robin!

Thanks for all the hard work Phil!

-pc
Requesting Gravatar... PK Jan 27, 2009 7:11 AM
# re: ASP.NET MVC Release Candidate
3 Cheers to the ASP.NET MVC krew @ MS :)

<3
Requesting Gravatar... Gavin Joyce Jan 27, 2009 7:33 AM
# re: ASP.NET MVC Release Candidate
Congratulations and thanks! I'm looking forward to rewriting DotNetKicks.com using MVC goodness.
Requesting Gravatar... Santos Ray Victorero, II Jan 27, 2009 7:41 AM
# re: ASP.NET MVC Release Candidate
Congratulations!

Thanks,

Santos
Requesting Gravatar... Lamin Barrow Jan 27, 2009 8:24 AM
# re: ASP.NET MVC Release Candidate
WOW.. I felt really obliged to comment here. I am just very very happy to here that. Hopefully i will create a template for the design Gallery to show my appreciation. Thank you. :D
Requesting Gravatar... Andrew Nurse Jan 27, 2009 9:07 AM
# re: ASP.NET MVC Release Candidate
Yay! Looking forward to checking out the new stuff
Requesting Gravatar... Sean M Jan 27, 2009 9:28 AM
# re: ASP.NET MVC Release Candidate
Hey Phil,

Another bug I've found is the change to the helpers with regards to generating urls.

I must be the only person who actually still uses asp.net web controls within my views (I bind data from my Model to controls via Page_Load)

Now I have a massive problem because the Url.Action / Url.Content methods return relative paths (they include ../ etc into pages, abd web control hyperlinks like to embed the path to the current view to the url as well, so now I get controls with a NavigateUrl of say /Views/Home/../Home/About, and the runtime shits itself about using .. in paths

Does no one else use the asp:HyperLink control anymore?

I can post a very succinct example of the failure:

http://www.arcturus.com.au/mvc/Index.aspx.txt

gives an example of it appending the path to the view + the url to the action

For the time being I'm using ResolveUrl rather than Url.Action
Requesting Gravatar... Danny Jan 27, 2009 11:17 AM
# re: ASP.NET MVC Release Candidate
Phil,

One word says it all. THANKS !
Requesting Gravatar... SoftMind Jan 27, 2009 12:04 PM
# re: ASP.NET MVC Release Candidate
Hi Phil,

Great News shared.

I am dying to work with IronRuby and Asp.Net MVC since ages, but no good news are seen nearby.

Can you kindly make it clear for once and all that should i leave all the hopes to work with IronRuby and Asp.Net MVC or i can still keep on dreaming with this.

No news are bad news.. and thats really frustrating.

Thanks
Requesting Gravatar... Adam Cooper Jan 27, 2009 12:18 PM
# re: ASP.NET MVC Release Candidate
Hi Phil,

Congratulations on the release candidate. The improvements look great.

For MVC Beta, I was using ModelState.AddModelError and ModelState.SetAttemptedValue, but the RC contains no SetAttemptedValue method. Instead, there is a similarly named method (I think it's SetModelValue or SetValue) that uses a ValueProviderResult in place of a simple string value. I thought the new RC API was pretty straightforward, but the method calls I ended up with seemed pretty wieldy and I wondered if perhaps I was missing something. Any guidance as to how to use the new RC API for adding errors and attempted values to model state?

Thanks much,
Adam
Requesting Gravatar... Simon Jan 27, 2009 12:30 PM
# re: ASP.NET MVC Release Candidate
awesome work. first time i've EVER been excited reading release notes. i recommend anybody that hasn't to read them. and its not that i've been waiting for features for months - i started MVC 6 days ago. its just testament to the skill of your team and attention to detail for complex issues. i find myself saying 'wow thats great' far more than usual.

First impressions:

I don't like the new method 'File' in Mvc.Controller. It conflicts with System.IO.File name, and is confusing becasue one is a class and the other is a method. I'm sure theres a better name for it that really describes what it does. 'File' is not very discoverable or a good indication of what it does.

Its great that 'Add View' doesn't ALWAYS add a codebehind file anymore. But how about an checkbox in the 'Add view' dialog to create one if I need it. I often like to write helpers to create my view. I understand exactly why it was removed (and originally why it was needed) but I want it back! PLEASE!!! I couldn't immediately see an easy way to add a codebehind file after the fact (apart from shift dragging a different file and then manually adding the correct inherits attribute - yuk).

Html.ValidationMessage(string modelName) has a slightly confusing name (the modelName parameter). How about changing the parameter name to 'modelPropertyName or 'propertyName' or 'fieldName'. When I first saw 'modelName' I'm thinking 'what! they want the name of my model class???'
Requesting Gravatar... Dave Jan 27, 2009 12:46 PM
# re: ASP.NET MVC Release Candidate
I'm having an issue with Ajax.BeginForm after upgrading a MVC Beta site to a RC1 site.

<% using (Ajax.BeginForm("Contact", "Home", new AjaxOptions { UpdateTargetId = "contact_modal", OnSuccess = "registerEvents", LoadingElementId = "contact_ajaxicon" }))
{ %>

The form using this tag works on the first ajax submission, but not on the second - using the mvc ajax debug file, I've confirmed that it's getting a 404 error - the first time it's correctly pointing to "Home/Contact", but on the second it points to just "Contact". This was working perfectly (and on many forms like this one) in the Beta version.

My eyes are glazing over looking at this - any ideas?

Thanks!
Requesting Gravatar... Simon Jan 27, 2009 1:02 PM
# Phew ! No jQuery 1.3.1
VERY VERY relieved here to see that jQuery 1.3.1 was NOT included in this version.

Theres a critical bug in 1.3.1 that I found -- the reporting of which I outsourced via stackoverflow.

In short $(function() { alert('Ready'); } does NOT execute when the DOM is loaded (as it should), but only executes when all images on the page are complete. This is an IE only issue which will lead to some pretty lousy responsiveness and probable race conditions from applications that have lots of images.

You'll want to at very least wait for a fix for this issue - and make a very thorough 'due diligence' decision as to whether or not to move to 1.3.x for RTM. I'm not sure what the jQuery community's overall reception has been of this release - but surprisingly they still have it posted as the recent version.

Here's more details including a link to the jQuery bug tracker and a test page for the bug:

stackoverflow.com/.../jquery-is-waiting-for-ima...
Requesting Gravatar... PaulBlamire Jan 27, 2009 3:47 PM
# re: ASP.NET MVC Release Candidate
Hi Phil, awsum news! Please let your team know that all their hard work is appreciated :-)
Requesting Gravatar... Boris Callens Jan 27, 2009 4:25 PM
# re: ASP.NET MVC Release Candidate
- What a glorious day!
Isn't it a glorious day mister sun?
- It's always a nice day with two scoops of raisins, Peter.
Requesting Gravatar... Colin Newell Jan 27, 2009 5:03 PM
# re: ASP.NET MVC Release Candidate
Awesome. Thanks. I've upgraded and it was reasonably painless.

Moving the AntiForgery token into the release was especially cool. I do have one question though, will you add a way to set the path of the cookie that it sets? If I have a live and test site in two separate virtual directories the cookies look like they will clash.
Requesting Gravatar... Eric Jan 27, 2009 5:08 PM
# re: ASP.NET MVC Release Candidate
Very nice :). Great release notes thanks !!

Are there good clear examples out there for the IModelBinder implementation ? Looks very interesting from what I saw in the notes, but haven't played around with that yet.
Requesting Gravatar... Khaja Minhajuddin Jan 27, 2009 7:08 PM
# re: ASP.NET MVC Release Candidate
Wooooooooohoooooooo!
I am very excited, we finally have a Release Candidate!
Requesting Gravatar... dario-g Jan 27, 2009 8:01 PM
# re: ASP.NET MVC Release Candidate
Hi, great stuff. Beta uninstalled and RC installed and... projest doesn't compile. Why FilePathResult within controller was named File??? File is the name of very often used class from System.IO!!! :(
Requesting Gravatar... Bill Gerold Jan 27, 2009 9:42 PM
# re: ASP.NET MVC Release Candidate - Dropdown list Issues
Great Work, I feel production release can't be far behind.

I am having issues with the DropDownList now.
I Use dropdowns extensively through out my application adn made various helpers that return a SelectList with an Item selected.
I use the following call
<%=Html.DropDownList("WellST",Html.StateSelectList(ViewData.Model.WellST), New With {.class = "ddl_Class"})%>
Which worked perfectly
With the new build however I get Overload resolution failed because no accessible 'DropDownList' can be called without narrowing conversion

Any ideas?
Requesting Gravatar... Nicolas Jan 27, 2009 10:23 PM
# re: ASP.NET MVC Release Candidate
Url.RouteUrl is broken. It returns a blank string for routes that used to work before. It seems that this is the case when targetting routes from another controller than the one which triggered the view. A major issue... all my site is broken.
Requesting Gravatar... Sigurdur G. Gunnarsson Jan 27, 2009 11:29 PM
# re: ASP.NET MVC Release Candidate
Great release, but I've immediately run into a problem while upgrading an application over from the beta.
This application has a WYSIWYG HTML editor, and I can't post the page anymore.
Error I get is: "A potentially dangerous Request.Form value was detected from the client"

And yes, Ive put validateRequest="false" in the web.config like instructed in the release notes and even tried it in the Page declaration. It doesn't seem to turn off!

For me this is a showstopper :(
Requesting Gravatar... Dale Weaver Jan 28, 2009 12:20 AM
# re: ASP.NET MVC Release Candidate
I think there is a bug with UpdateModel(<TModel>). I'm following the tutorial at http://www.asp.net/learn/mvc/tutorial-01-vb.aspx. My code looks like this:


[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(FormCollection collection)
{
var newMovie = new Movie();
try
{
var newMovie = new Movie();
UpdateModel(newMovie, collection.ToValueProvider());
_db.AddToMovies(newMovie);
_db.SaveChanges();
return RedirectToAction("Index");
}
catch
{
return View();
}
}

In the database all fields don't allow null values. But when I fill out the insert form in asp.net mvc and leave all fields blank and click submit, no errors are thrown on string fields and empty strings are inserted into the database. Date/Time fields throw validation errors but not string fields.
Requesting Gravatar... achu Jan 28, 2009 12:34 AM
# re: ASP.NET MVC Release Candidate
i swtiched to asp.net mvc yesterday onwards. i think microsoft ajax is super easy now. one thing i noticed in the beta is Built in model binder automatically assign prefix as the name of parameter. why not assign default prefix as empty.

thanks for the great product.
Requesting Gravatar... dario-g Jan 28, 2009 12:37 AM
# re: ASP.NET MVC Release Candidate
There's more bugs :( Bugs for me and like I see for others too becouse with MVC Beta 'everything' work fine.
Eg:
- Url.Action("About") returns "About" not "Home/About"
- The same Html.BeginForm
- I have few methods in MasterPage code behind, compiles but in runtime throws exception MethodNotFound
- validateRequest=false not worked for me, too
- Url.RouteUrl not worked for me, too
- Where is Cancel property in AuthorizationContext?
- What happed with public virtual method GetListItems in SelectList?

Please, help :/
Requesting Gravatar... haacked Jan 28, 2009 1:20 AM
# re: ASP.NET MVC Release Candidate
@dario-g did you read the release notes about upgrading existing projects? The Action method now renders relative paths. When you click on the link rendered, does it not work?

@Dave, Could you post a repro to the Forums?

Requesting Gravatar... Dave Jan 28, 2009 2:10 AM
# re: ASP.NET MVC Release Candidate
Phil - I started this thread here, which you answered - I realized after I posted here that I probably shouldn't have used your blog post for a support forum.

forums.asp.net/p/1376650/2898567.aspx#2898567

Essentially I rolled back to Beta for now - if there's a good workaround that you would recommend in the meantime (there's one on the forum thread linked to above, but I haven't tried it yet), I'll do that and wait for the full release in a month or so.

Thanks again!
Requesting Gravatar... Steve Jan 28, 2009 3:25 AM
# re: ASP.NET MVC Release Candidate
Hey Phil, I love the new RC1.

Question:

I separate my controllers out into their own assembly.

This renders some of the cool features, apparently unusable for me.

Is there a way to tell the project where my controllers are so I can take advantage of the new features (like goto controller)
Requesting Gravatar... Jirapong Nanta Jan 28, 2009 3:36 AM
# re: ASP.NET MVC Release Candidate
Thank you, and cheer up.

Note that,
I get an error while installing the VS.NET Template process, after click 'ok', Visual Studio automatic start up
Requesting Gravatar... Piers Jan 28, 2009 3:56 AM
# re: ASP.NET MVC Release Candidate
I've already updated my RESTful web serviceexample based on MVC. The update was easy thanks to the comprehensive realse notes:

shouldersofgiants.co.uk/.../...edness-to-JSON.aspx
Requesting Gravatar... Andy Jan 28, 2009 3:56 AM
# re: ASP.NET MVC Release Candidate
Can we can using patterns for actionlinks? <% using (Html.ActionLink(null, "ViewProduct", "Products") { %><img .... /><% } %></div>
Requesting Gravatar... Gergely Orosz Jan 28, 2009 5:36 PM
# re: ASP.NET MVC Release Candidate
I like the helpers you added to prevent cross site scripting attacks. Good job!
Requesting Gravatar... Jeff Jan 29, 2009 1:15 AM
# re: ASP.NET MVC Release Candidate
Would be great if you guys could display a date next to the tutorials and videos on www.asp.net/mvc so people know which ones are the newest. I see the "NEW" icon but it's kind of ambiguous - a date would clear it up nicely.
Requesting Gravatar... secretGeek Jan 29, 2009 12:44 PM
# re: ASP.NET MVC Release Candidate
This is fantastic work Phil.

I printed out the gu's description of all the changes and read it on the bus last night.

Everything you guys have done for the RC is just golden!

I am just itching to deliver some MVC goodness to someone. You deserve all the praise you can handle.
Requesting Gravatar... George Mauer Jan 30, 2009 12:34 AM
# re: ASP.NET MVC Release Candidate
Problem installing it contact vendor blah blah blah. I submitted the error report but now I don't have MVC Beta or RC1...boo
Requesting Gravatar... Andrej Gaevskij Feb 01, 2009 5:45 PM
# re: ASP.NET MVC Release Candidate
Thanks for great release, Phil & Co. :)
@Sigurdur G. Gunnarsson use [ValidateInput(false)]
Requesting Gravatar... Tombob Feb 17, 2009 11:26 PM
# re: ASP.NET MVC Release Candidate
Regarding below post, I had the same issue albeit I wqas using a jquery json call. I found if I used the javascript escape function on my input it solved the issue.


Great release, but I've immediately run into a problem while upgrading an application over from the beta.
This application has a WYSIWYG HTML editor, and I can't post the page anymore.
Error I get is: "A potentially dangerous Request.Form value was detected from the client"

And yes, Ive put validateRequest="false" in the web.config like instructed in the release notes and even tried it in the Page declaration. It doesn't seem to turn off!

For me this is a showstopper :(
Requesting Gravatar... haacked Feb 18, 2009 2:00 AM
# re: ASP.NET MVC Release Candidate
@Tombob Unfortunately, putting it in the Page is way too late. Your controller logic already ran.

So you need to put the [ValidateRequest(false)] attribute on the Controller action in order to turn it off for that action.
Requesting Gravatar... Paul Mungai Feb 18, 2009 9:35 PM
# re: ASP.NET MVC Release Candidate
Hi Phil,

Great work! I appreciate.

One question; what happened to BinaryStreamResult that was part of Futures Beta? I just upgraded to Futures RC1 and my code has broken :-(

Thanks!
Requesting Gravatar... VB Helper Apr 03, 2009 10:09 PM
# re: ASP.NET MVC Release Candidate
Hi,

What is the VB version of this one?

<% using (Ajax.BeginForm("Contact", "Home", new AjaxOptions { UpdateTargetId = "contact_modal", OnSuccess = "registerEvents", LoadingElementId = "contact_ajaxicon" }))
{ %>

Dave ask about this above (not the vb version), but seems like ajaxing a form won't do. :(


cheers,
Requesting Gravatar... Bellaplex Mar 18, 2010 8:55 PM
# re: ASP.NET MVC Release Candidate
ASP.NET can be used to make the Internet appear dynamical, faster and much more effective.
Requesting Gravatar... marco Oct 06, 2010 2:10 AM
# re: ASP.NET MVC Release Candidate
I like the way the controller instantiates and wraps the descendant stuff.
Comments have been closed on this topic.