现在MVC的技术日趋成熟,面对着不同版本的MVC大家不免有所迷惑 -- 它们之间有什么不同呢?下面我把我搜集的信息汇总一下,以便大家能更好的认识不同版本MVC的功能,也便于自己查阅。

View Engine :
View Engine is responsible for rendering of the HTML code from your views to the browser.
MVC 2 uses only Web Forms view engine (.aspx) as a default View Engine.
MVC3 uses Razor View Engine (.cshtml for c# and .vbhtml for Visual Basic) and Web Forms view engine (.aspx).
MVC4 also uses Razor View Engine as a default view engine with some new features like condition attribute and ‘Tilde slash’.

Chart, WebGrid, Crypto,WebImage, WebMail Controls :
All these are not available in MVC2.
All these are available in MVC3 and in MVC4.

Syntex :
(HTML Syntax) Web Forms view engine syntax: <%=Html code %> in MVC2.
(Razor Syntax) Razor View Engine syntax: @Html code in MVC3.
MVC4
has the same Razor View Engine Syntax but with the addition of new
features like conditional attribute and ‘Tilde Slash’ i.e. URL
resolution.

Objects available for sharing of data between View and Controller :
TempData, ViewData are available in MVC2.
TempData, ViewData ,ViewBag are available in MVC3.
TempData, ViewData ,ViewBag are available in MVC4.
> TempData is used with current and subsequent request i.e. when you know the next view to be redirected.
> In ViewData, dictionary of objects are accessible via strings as keys.
>
ViewBag was added in the C# 4.0 which uses the dynamic feature that
allows to add properties of an object dynamically . We can say that
ViewBag = ViewData + dynamic feature around the ViewData dictionary.

Jquery Support :
Jquery support is Good in MVC2.
Jquery support is Better in MVC3.
MVC4 provides better support for Jquery like Jquery Mobile.

Dependency Injection Support :
Dependency injection is Good in MVC2.
It provides powerful hooks with Dependency Injection and Global Action Filters in MVC3.
Better support in MVC4.

Layout Support :
Supports only Master Page in MVC2.
Supports not only Master Page but also Layout Page in MVC 3 and in MVC4.

Validation :
Client-side Validation and Asynchronous controllers is there in MVC2.
Unobtrusive Ajax and Client side Validation, Jquery Validation and JSON binding support is in MVC3.
Client side validation, Jquery validation and enhanced support for asynchronous methods in MVC4.

Project Templates :
MVC3 supports project templates enabled by HTML 5.
MVC4
supports many new features for mobile apps and also provides new mobile
project template and default templates are refreshed and modernized.

New features in asp.net mvc 5:
1. One ASP.NET
2. Asp.Net Identity
3. Bootstrap in the MVC template
4. Authentication Filters
5. Filter overrides
You can get the more details from Microsoft MSDN http://www.asp.net/visual-studio/overview/2013/release-notes#TOC10

还是用英文,希望大家养成英文阅读的习惯 :)

[ASP.Net] MVC2,3,4,5的不同的更多相关文章

  1. Asp.net MVC2中你必须知道的扩展点(一):Controller Factory

    Asp.net mvc2中提供很多可以扩展的地方,利用这些扩展之后,asp.net mvc使用起来更加灵活.Simone Chiaretta曾写过一篇文章:13 ASP.NET MVC extensi ...

  2. ASP.NET MVC2.0 自定义filters

    今天大家共同学习下ASP.NET MVC2.0中自定义filters,这一节主要学习下ActionFilterAttribute, ActionFilterAttribute继承IActionFilt ...

  3. ASP.NET MVC2.0学习笔记:路由设置

    Route设置 在 <Professional in ASP.NET MVC2.0>一书的第四章,主要讲述了Route的简单设置.格式化设置.约束设置.区域路由.匹配文件.路由调试以及对R ...

  4. Asp.Net MVC2.0 Url 路由入门---实例篇

    本篇主要讲述Routing组件的作用,以及举几个实例来学习Asp.Net MVC2.0 Url路由技术. 接着上一篇开始讲,我们在Global.asax中注册一条路由后,我们的请求是怎么转到相应的Vi ...

  5. Asp.Net MVC2.0 Url 路由入门---实例篇 【转】

    本篇主要讲述Routing组件的作用,以及举几个实例来学习Asp.Net MVC2.0 Url路由技术. 接着上一篇开始讲,我们在Global.asax中注册一条路由后,我们的请求是怎么转到相应的Vi ...

  6. [ASP.NET MVC2 系列] ASP.Net MVC教程之《在15分钟内用ASP.Net MVC创建一个电影数据库应用程序》

    [ASP.NET MVC2 系列]      [ASP.NET MVC2 系列] ASP.Net MVC教程之<在15分钟内用ASP.Net MVC创建一个电影数据库应用程序>       ...

  7. IIS 6.0上部署ASP.NET MVC2.0

    在IIS7.5及8.0上部署都没有成功,对于身份验证会出现问题,据说是要安装什么东西,在这里说下IIS6.0的配置吧,下面是使用.net 4.0,自己可以选择所需的版本. 再此之前先确定web是用到了 ...

  8. [转]Asp.net Mvc2中重构View的三种方式

    本文转自:http://www.cnblogs.com/zhuqil/archive/2010/07/14/asp-net-mvc2-view-refactoring.html 我们在Asp.net ...

  9. [转载]Asp.net MVC2 与 MVC3 路由调试好帮手RouteDebug 与 RouteDebugger

    RouteDebug 与 RouteDebugger是什么? 在Asp.Net MVC程序中,路由(Route)是一个非常核心的概念,可以说是MVC程序的入口,因为每一个Http请求都要经过路由计算, ...

  10. asp.net MVC2.0学习笔记

    asp.net;与mvc都是不可替代的:只是多一种选择:(解决了许多asp.net的许多缺点) model:充血模型.领域模型:很大程度的封装: 控制器:处理用户的交互,处理业务逻辑的调用,指定具体的 ...

随机推荐

  1. Retrofit 传递json 和 复杂参数类型List<T>

    1 首先你要定义一个接口 @POST Call<String> post(@Url String url, @Body String info); 2 创建一个service public ...

  2. 努比亚 Z17 mini s (Nubia NX589J) 解锁BootLoader 并刷入recovery ROOT

    首先下载好工具链接:链接:https://pan.baidu.com/s/1gher4T9 密码:rypn 备用下载链接:https://pan.baidu.com/s/1nxdzt9Z 本篇教程教你 ...

  3. AI:忧郁的机器人

    1.塔奇克马 塔奇克马研究起来哲学,被缴械....... 2.机器人瓦力 孤独等待EVA的瓦力 3.马文 http://www.guokr.com/post/683881/

  4. ubuntu16.04安装KDE

    由于对KDE界面情有独钟,升级到ubuntu之后,第一件事就是安装kde桌面 命令: add-apt-repository ppa:kubuntu-ppa/backports apt-get upda ...

  5. java中的位运算及移位运算

    为了方便对二进制位进行操作,Java给我们提供了以下四个二进制位操作符: &    按位与 |     按位或 ^    按位异或 ~    按位取反 Java中有三个移位运算符: 左移:&l ...

  6. [iOS Reverse]logify日志追踪,锁定注入口-控制台查看

    前言 logify是theos的一个组件,路径是: /opt/theos/bin/logify.pl 我们还是以微信红包为例子,根据[iOS Hacking]运行时分析cycript得到的入口文件: ...

  7. spirngMvc

    配置方式就略了 直接开始注解方式: 1.  新建项目 2.  导入jar包 3.  创建controller,用注解方式声明 4.  在web.xml配置核心分发器DispatcherServlet ...

  8. Memcached 之取模与哈希算法命中率实验

    当5台memcache服务器中有一台宕机时的命中率实验. 一.php实现代码 1. config.php $server = array( "A" => array(&quo ...

  9. uni-app的专属强大自适应单位upx,但是这个这是一个大坑,不能动态赋值解决办法

    uni-app 使用 upx 作为默认尺寸单位, upx 是相对于基准宽度的单位,可以根据屏幕宽度进行自适应.uni-app 规定屏幕基准宽度750upx. 开发者可以通过设计稿基准宽度计算页面元素 ...

  10. jQuery实现菜单全选/不选

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...