现在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.

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

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

文章引自:http://bubuko.com/infodetail_40420.html

MVC5详细介绍教程Getting Started with Entity Framework 6 Code First using MVC 5(英文):http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application

MVC2、MVC3、MVC4、MVC5之间的区别 以及Entity Framework 6 Code First using MVC 5官方介绍教程的更多相关文章

  1. MVC2 ,MVC3 ,MVC4,MVC5的区别,EF的各个版本的区别;LocalDB是个啥

    2010年發行ASP.NET MVC 2.0版,2011年發行ASP.NET MVC 3.0版,2012年發行ASP.NET MVC 4.0版 MVC3 需要.net framework 4.0 版本 ...

  2. MVC2,MVC3,MVC4和MVC5的不同

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

  3. Entity Framework 6 Code First +MVC5+MySql/Oracle使用过程中的几个问题

    1. namespace Snapsia.Web.Models { using System; using System.Data.Entity; using System.ComponentMode ...

  4. 《ASP.NET MVC4 WEB编程》学习笔记------Entity Framework的Database First、Model First和Code Only三种开发模式

    作者:张博出处:http://yilin.cnblogs.com Entity Framework支持Database First.Model First和Code Only三种开发模式,各模式的开发 ...

  5. asp.net mvc5 step by step(三)—— Entity Framework Database First

    一.先建数据库. 打开,SQL Server Management 新建数据库Employee 并新建表 /****** Object: Table [dbo].[t_Employee] Script ...

  6. 使用MVC5的Entity Framework 6入门 ---- 系列教程

    使用MVC5的Entity Framework 6入门(十二)——为ASP.NET MVC应用程序使用高级功能 为ASP.NET MVC应用程序使用高级功能这是微软官方教程Getting Starte ...

  7. Jquery中.bind()、.live()、.delegate()和.on()之间的区别详解

    简介 最近了解到很多网页开发者对jquery中的 .bind() .live() .delegate() 和 .on() 方法存在很多的疑惑.这些疑惑通常是关于它们之间真正的区别是什么啊,什么时候该使 ...

  8. MVC5 Entity Framework学习之Entity Framework高级功能(转)

    在之前的文章中,你已经学习了如何实现每个层次结构一个表继承.本节中你将学习使用Entity Framework Code First来开发ASP.NET web应用程序时可以利用的高级功能. 在本节中 ...

  9. MVC5 Entity Framework学习之Entity Framework高级功能

    在之前的文章中,你已经学习了怎样实现每一个层次结构一个表继承. 本节中你将学习使用Entity Framework Code First来开发ASP.NET web应用程序时能够利用的高级功能. 在本 ...

随机推荐

  1. BZOJ3261 最大异或和 (可持久化Trie)

    ; len=; var x,y,z,n,m,tot,lx,i:longint; sum:..maxn] of longint; rt:..maxn] of longint; time,l,r:..ma ...

  2. C# subString的理解

    public void TestMethod1()        {            string str = "ABCDEFGHIJKLMN"; string result ...

  3. mysql 获得当前月1号的日期 和 0点日期方法

    day)) 当月0点时间:2015-12-01 00:00:00 day)) 当月1号时间:2015-12-01 10:45:22 day) 2015-12-01 <!-- 查询上月债权额度 - ...

  4. Hive on Spark运行环境搭建

    Hive是基于Hadoop的开源数据仓库工具,提供了类似于SQL的HiveQL语言,使得上层的数据分析人员不用知道太多MapReduce的知识就能对存储于Hdfs中的海量数据进行分析.由于这一特性而收 ...

  5. 多个Tomcat同时运行环境配置 - imsoft.cnblogs

    解压下载好的Tomcat压缩包,两次.此例中分别命名为tomcat和tomcat2. 1. 在MyEclipse中配置好第一个Tomcat环境,可以正常运行项目后. 2. 再配置tomcat2这个项目 ...

  6. MyEclipse 10 和 2014 两个版本共存破解 - imsoft.cnblogs

      第一步:运行 (run.bat)文件, 输入任意用户名 第二步:点击Systemid... 按钮,自动生成本机器的systemid. 第三步: 点菜单Tools->RebuildKey 第四 ...

  7. Wamp安装使用+Git for Windows

    相信很多朋友都曾在windows上做过web开发,我们常用的Web应用程序平台是:Apache+Mysql+Perl/PHP/Python,在windows下集成称为WAMP.web开发新手有时候由于 ...

  8. elfutils-libelf由于依赖而安装失败

    在Redhat安装Oracles前需要按照依赖包,但是在安装elfutils-libelf遇到了两个包相互依赖的情况 [root@rhvm1 /]# rpm -i elfutils-libelf-de ...

  9. OpenCV: Canny边缘检测算法原理及其VC实现详解(转载)

    原文地址:http://blog.csdn.net/likezhaobin/article/details/6892176 原文地址:http://blog.csdn.net/likezhaobin/ ...

  10. Android—菜单

    layout文件: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:an ...