'What is the difference between mvc2 and mvc3 template in visual studio?
What is the difference between mvc2 and mvc3 template in visual studio? Can I use MVC2 template instead of MVC3 template? Just a beginner, so want to create some samples in MVC3 framework.
Solution 1:[1]
MVC3 has some new updated feature than MVC2
Top Features in MVC3
- Integrated Scaffolding system extensible via NuGet
- HTML 5 enabled project templates
- Expressive Views including the new Razor View Engine
- Powerful hooks with Dependency Injection and Global Action Filters
- Rich JavaScript support with unobtrusive JavaScript, jQuery Validation, and JSON binding
Solution 2:[2]
I suggest you to read this article.
To name few following are list of some advantages of MVC3 over MVC2.
- You can use the Razor View Engine, which depending on your requirements, it will make your view code nicer.
- Partial Page output caching is a great feature for systems that share bits and pieces across different UI's.
- Unobtrusive JavaScript and Validation is also another great new feature that will help you keep your code's maintainability among other benefits.
- MVC3 also has some benefits from the dynamic aspects of .NET 4, and that also helps you keep your view code cleaner.
- NuGet Package Manager Hope this help!
Solution 3:[3]
Here are some points of difference among the two:
1.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).
2.Syntax : (HTML Syntax) Web Forms view engine syntax: <%=Html code %> in MVC2. (Razor Syntax) Razor View Engine syntax: @Html code in MVC3.
3.Chart, WebGrid, Crypto,WebImage, WebMail Controls : All these are not available in MVC2. All these are available in MVC3 and in MVC4.
4.Objects available for sharing of data between View and Controller : TempData, ViewData are available in MVC2. TempData, ViewData ,ViewBag are available in MVC3.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Kishore Kumar |
Solution 2 | Peace ON |
Solution 3 | yanky_cranky |