Now that MVC is maturing, it's confusing to face different versions of MVC--what's the difference between them? Below I gather the information I collected, so that we can better understand the different versions of MVC features, but also easy to check.
View Engine:
View Engine is responsible-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 is not available in MVC2.
All these is 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 have the same Razor View Engine Syntax but with the addition of new features like conditional attribute and ' tilde Sla Sh ' i.e. URL resolution.
Objects available for sharing of data between View and Controller:
TempData, ViewData is available in MVC2.
TempData, ViewData, ViewBag is available in MVC3.
TempData, ViewData, ViewBag is 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 is 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 was good in MVC2.
Jquery support was 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 MVC4.
Validation:
Client-side Validation and asynchronous controllers are there in MVC2.
Unobtrusive Ajax and Client side Validation, Jquery Validation and JSON binding support are 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 is re Freshed and modernized.
New features in ASP. NET MVC 5:
1. One ASP.
2. ASP.
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
Or in English, I hope you develop the habit of reading English:)
[ASP] The difference between mvc2,3,4,5