Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC or ASP.NET MVC2 RC2 -> RTM

I am designing an green field application, development will start on it tomorrow as all the User Stories, etc. have been finalized. I plan on using Windows Azure, with ASP.NET MVC, I noticed that MVC 2 RC2 is about to be released but there is a lot less literature on MVC 2 compared to MVC 1. Are there substantial differences between the two versions? I am thinking it would be prudent for me to just start using MVC 2 now, rather than later...

What do you guys think?

like image 344
emalamisura Avatar asked Dec 23 '22 05:12

emalamisura


2 Answers

Go with MVC2. Scheduled release time is likely to be next month considering it's in RC now. Despite one of the other posters saying there are minor changes, there are actually significant changes:

  • Strongly typed extension helpers
  • Strongly typed views
  • View model data annotation validation
  • Many performance improvements w/r to caching the "reflecting" parts of the code (expression trees can get expensive)

One of the best features provided you're developing for .NET 4 is the <%: syntax for automatic HTML encodes for strings in your views.

So instead of using:

<%= Html.Encode("<script>alert('you've been hacked');</script>") %>

You can do this:

<%: "<script>alert('you've been hacked');</script>" %>

Think of it like turning the equal sign sideways, like closing the gate.

like image 128
Craig Huber Avatar answered Dec 29 '22 09:12

Craig Huber


If you are confident that your go-live date will be well past the planned release date for MVC2, then I'd go with MVC2.

like image 43
Richard Ev Avatar answered Dec 29 '22 09:12

Richard Ev