现在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. node 连接MySQL及其分装, 连接池连接

    const mysql = require('mysql') const config = require('./../../config/config.default') var connectio ...

  2. mssql server 2005自动备份数据库

    (转) (1)启动[sql server Management Studio],在[对象资源管理器]窗口里选择[管理]——[维护计划]选项. 2)右击[维护计划],在弹出的快捷菜单里选择[维护计划向导 ...

  3. Deutsch lernen (10)

    Dieser Weg Dieser Weg wird kein leichter sein. Dieser Weg wird steinig und schwer. Nicht mit vielen ...

  4. 【技术累积】【点】【Java】【12】几种常见编码(持续更新)

    问题描述 有这么一段代码: String question = new String(record.getQuestion().getBytes("iso-8859-1"), &q ...

  5. mvc自定义控件

    //自定义一个DatePicker.cshtml文件@helper Init() { <link href="~/Content/mobiscroll.custom-2.5.0.min ...

  6. sql 排序

    select count(*) from vote group by contents PERCENT * from vote order by contents)as A group by cont ...

  7. jquery判断字符串中是否存在某个的字符串

    有两种方式: 1)test 2)indexOf $(function(){ var str="sunny,woo"; var sear=new RegExp(','); if(se ...

  8. 阿里云对象存储服务,OSS使用经验总结,图片存储,分页查询

    阿里云OSS-使用经验总结,存储,账号-权限,分页,缩略图,账号切换 最近项目中,需要使用云存储,最后选择了阿里云-对象存储服务OSS.总的来说,比较简单,但是仍然遇到了几个问题,需要总结下. 1.O ...

  9. Linux磁盘分区方案(转)

    硬盘分区的各个分区的意义 尽管可以根据我们已经提到的分区原则,Linux装在一个单一的大分区中,但更好的主意是将它分开.综合了单一分区的简单性和多分区的灵活性,我们推荐以下配置.请注意:如果你想安装L ...

  10. Linux显示使用命令who(转)

    Linux who命令用于显示系统中有哪些使用者正在上面,显示的资料包含了使用者ID.使用的终端机.从哪边连上来的.上线时间.呆滞时间.CPU使用量.动作等等. 使用权限:所有使用者都可使用. 语法 ...