Differences between MVC2, MVC3, MVC4, MVC5, and entity Framework 6 Code first using MVC 5 official Introduction Tutorial

Source: Internet
Author: User

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 UsesOnly 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 ViewEngine 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.
BetterSupport in MVC4.

View Engine:
View Engine is responsible-rendering of the HTML code from your views to the browser.
MVC 2 UsesOnly 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 ViewEngine 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.
BetterSupport 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 AR e refreshed and modernized.

New features in ASP. 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 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 De Fault templates is refreshed 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

Article citation: http://bubuko.com/infodetail_40420.html

MVC5 detailed tutorial getting Started with Entity Framework 6 Code first using MVC 5 (English): 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

Differences between MVC2, MVC3, MVC4, MVC5, and entity Framework 6 Code first using MVC 5 official Introduction Tutorial

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.