现在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. 启动MyEclipse 出现java.lang.RuntimeException: No application id has been found 解决办法

    咋一看,太熟悉了,就去eclipse\links 目录下,发现指定的MyEclipse的路径不对. 突然想起来了,MyEclipse是换地了. MyEclipse里面内置的eclipse找不到MyEc ...

  2. Morse理论:拓扑不变性特征匹配原理

    设计精美的宽基线双目相机镇文 Mo'ersi lilun莫尔斯理论(卷名:数学) Morse theory 微分拓扑的一个重要分支.通常是指两部分内容:一部分是微分流形上可微函数的莫尔斯理论,即临界点 ...

  3. QT显示框架嵌入Vs控制台工程

      一.一些准备工作: 1.安装Qt for VS 的插件: 安装Qt for VS 的插件 下载地址:http://download.qt.io/official_releases/vsaddin/ ...

  4. GET 请求控制器 返回绑定后HTML

    //$.get("/Home/index/" + $("#S_BookName").val(), function (data) { //MVC控制器返回Vie ...

  5. 移动pc常用Meta标签

    移动常用 <meta charset="UTF-8"> <title>{$configInfos['store_title']}</title> ...

  6. jmeter的性能监控框架搭建记录(Influxdb+Grafana+Jmeter)

    查看笔记 http://note.youdao.com/noteshare?id=c700365713abb98bd3d10e6f45393af9&sub=6F4E14FF3F9D4167AE ...

  7. 【剑指Offer】33、丑数

      题目描述:   把只包含质因子2.3和5的数称作丑数(Ugly Number).例如6.8都是丑数,但14不是,因为它包含质因子7. 习惯上我们把1当做是第一个丑数.求按从小到大的顺序的第N个丑数 ...

  8. 单点登录之 CAS SSO 从入门到精通(第一天)

    转自:http://blog.csdn.net/lifetragedy/article/details/43817903 啊......it's quite a long time. 好久没更新博客了 ...

  9. 10.01QBXT集训

    a[问题描述]你是能看到第一题的 friends呢.—— hja何大爷对字符串十分有研究,于是天出题虐杀 zhx.何大爷今天为 何大爷今天为 字符串定义了新的权值计算方法.一个由小写母组成,被定义为其 ...

  10. C#关键字的个人理解与注释

    C#关键字注释:abstract:抽象as:类型转换(返回转换结果)base:基类bool:布尔类型break:条件中断语句byte:字节case:条件语句catch:异常捕获后执行char:16 位 ...