Reason to upgrade from ASP.NET MVC2 to MVC3 [closed]

。_饼干妹妹 提交于 2019-12-02 22:45:34

Here's a few additional features in ASP.NET MVC 3

  1. Razor view engine (Widely seen as a vast improvement on the previous ASPX view engine)
  2. Improved model validation with unobtrusive JavaScript and jQuery support. Including new remote validation amoungst others
  3. Partial page output caching.
  4. Dependency Injection Improvements, new IDependencyResolver`

More imporvements and details can be found at ASP.NET MVC site along with Scott Guthrie's anouncment

But only you can evaluate whether you should upgrade or not for your specific project.

It should be noted (as Robert Koritnik commented) that MVC 3 requires .NET 4.

No more custom controller factory! This will apply to you. They wrote a new IDependencyResolver that you implement and DependencyResolver.SetResolver(...). Your IoC will go through out the application.

http://weblogs.asp.net/shijuvarghese/archive/2011/01/21/dependency-injection-in-asp-net-mvc-3-using-dependencyresolver-and-controlleractivator.aspx

The main two reasons we're about to upgrade are:

1) The ability to control HTML validation on a per textbox basis rather than on a whole page- this means we can allow the users to enter HTML into some textboxes on a page, rather than having to control it at the page level.

2) Remote validation - much less ajax for us to write!

1 Razor

2 Razor Intellisense within Visual Studio

3 Partial Page Output Caching

4 Validation and JavaScript/AJAX improvements

The Razor View Engine will make your view code nicer.

More details here

Apart from all the answers there are few other reason for adopting MVC 3

  1. Unobtrusive Javascript
  2. Global Action Filters
  3. Custom Validation attributes and Self validation
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!