2009 ASP. NET MVC version 1.0
2010 ASP. NET MVC version 2.0
2011 the launch of ASP. NET MVC version 3.0 +EF4, required. Net4.0 Support
2012 the launch of ASP. NET MVC version 4.0 +EF5, required. Net4.0 Support
2013 the launch of ASP. NET MVC version 5.0 +ef6, required. Net4.5 Support
2015 the launch of ASP. NET MVC version 6.0 +ef7, required. Net5.0 Support
MVC3
Multi-View engine support
in ASP. NET MVC3, the Add View dialog box allows you to select the view engine you want, in the New Project dialog box you can specify the project default view engine, you can choose Webform,razor, or open source view engine, for example: Spark, Nhaml, or Ndjango.
improvements to the controller
Global Action Filter
Sometimes you want to be able to perform some processing logic before or after an action method executes, and in ASP. NET MVC2, an action filter is provided to allow the action method of a particular controller to be processed, and in fact, there are times when you want to For similar processing, MVC3 allows you to add filters to the Globalfilters collection to create a global filter.
the new ViewBag property
The controller in MVC2 supports the ViewData property, allowing the data to be passed to the view template via a later-bound dictionary, which you can do more easily with ViewBag in MVC3. For example, for viewdata["Message"] = "text", you can do this by viewbag.message = "Text". You do not need to define any strongly typed properties through the class, because this is a dynamic property, and internally, the ViewBag property is stored in the ViewData dictionary as a name-value pair. Note that in many pre-release versions, this property is called ViewModel.
new type of ActionResult
The following actionresult types are new or expanded in MVC3.
JavaScript and Ajax improvements
By default, in MVC3, Ajax and validation use an unobtrusive unobtrusive JavaScript approach. Unobtrusive does not insert inline JavaScript in HTML, which makes HTML more streamlined and less intrusive, makes it easier to replace and customize the JavaScript library, and in MVC3, the validation assistant defaults to using the Jquery.validate plugin Complete, if you want to use MVC2 behavior, you can turn unobtrusive off by configuring it in Web. config.
client-side validation is enabled by default
In previous versions of MVC, you needed to explicitly call the Html.enableclientvalidation method in the view to enable client-side validation. In MVC3, it is no longer necessary because client-side validation is enabled by default. Can be closed in Web. config.
To make the client-side verification work, you still need to include a reference to the JQuery and jquery.validation libraries on your site, which you can provide on your website, or use Microsoft or Google's CDN server.
Remote Authentication
ASP. NET 3 provides support for remote validation of the JQuery Validation plugin via a new label Remoteattribute. This allows the client's validation library to automatically invoke a custom method that you define on the server to complete the validation logic that can only be done on the server.
In the following example, the Remote tag specifies that the user name field is validated by a method defined in Userscontroller named Usernameavailable.
-
- Razor syntax is simple and clear, requires minimal input
- Razor easy to learn, syntax similar to C # and VB
- Visual Studio provides smart hints and syntax for Razor Coloring
- Razor view You do not need to allow a program or start a WEB server to test
- @model to specify the model type to upload to the view
- @* * Comment Syntax
- for the entire Sites can set default items at once, such as layouts. The
- Html.raw method provides output that is not Html-encoded
- supports sharing code between multiple views (_viewstart.cshtml or _viewstart.vbhtml)
- C Hart. Generate chart
- WebGrid, generate data tables, support full paging and sorting
- Crypto, use hash algorithm to create hash and salt-added passwords
- webimage, generate pictures
webmail, send e-mail
- httpnotfoundresult. Returns the 404 HTTP status to the client.
- Redirectresult. Returns a temporary redirect (HTTP 302 status code) or persistent redirection (HTTP 301 status code) based on a Boolean parameter, which, in combination with this improvement, provides the Controller with three A method to support persistent redirects: Redirectpermanent, Redirecttoroutepermanent, and Redirecttoactionpermanent. These methods return a Redirectresult object instance with a Permanent property of true.
- httpstatuscoderesult. Returns the user-specified HTTP status code.
JSON Binding Support
The ASP. NET MVC3 contains built-in JSON binding support that allows the action method to receive JSON-encoded data and model it as an action parameter. This capability is often used in client-side templates and data binding. Client templates allow you to format and display one or more data through the client's template, MVC3 allows you to simply connect client templates and server-side Action methods, send and receive data through JSON, and more information refer to: Scott Guthrie's MVC 3 Preview blog post.
Validationattribute class
The improved Validationattribute class in. NET FRAMEWORK4 supports the new IsValid overloads, providing more information about the current validation context, such as what objects have been validated. This allows you to validate the current value based on other properties of the model, for example, the new compareattribute allows you to compare the values of the two properties of the model, in the following example, the ComparePassword property must match the Password field to pass the validation.
improvement of Model validation
DataAnnotations Meta Data labels
The ASP. MVC3 supports dataannotations metadata tags, such as: DisplayAttribute.
- public class User
- {
- [Required]
- public string Password {get; set;}
- [Required, Compare ("Password")]
- public string ComparePassword {get; set;}
- }
MVC4
MVC4 when created in vs2012 or above, the default is. NET framework4.5, but we can modify it to. NET 4.0 (that is, on 2003 of the server, or can be on the MVC4, the installation process refer to the windows2003 IIS6 deploying MVC3 and MVC4 Programs ASP. NET MVC4.0 (downgrade from net4.5 to 4.0) to the solution on Windows Server 2003
However, net Framework4.5 is not supported on Windows Server 2003 )
ASP. 4.5 MVC upgrade to MVC4, more Webapi
vs2013 inside ASP. NET 4.5.1 MVC upgraded to MVC5, Webapi upgraded to webapi2.0
MVC5
more support for WEBAPI 2.0 (you can see this http://www.cnblogs.com/artech/p/web-api-sample.html)
ASP. NET MVC 5 brings a new developer experience, one ASP. NET integration of the new model system, through a single portal to complete the selection of all Web templates, the various web templates can also be flexibly combined with new templates, such as Web Forms + Web API. MVC 5 provides a more resilient Membership authentication system, where developers are free to define the required data schema without being restricted to a fixed schema through code first. With a new Web Fan Benjie surface designed with bootstrap, Bootstrap provides a high degree of resiliency, enabling developers to quickly own the architecture page interface and develop the ability to support responsive Web pages (responsive web).
With the release of Visual Studio 2013, development tools are taking a big step forward, and it's unifying the experience, and now you can implement the same set of features, no matter how you start to build an ASP. For example, developers can join Web APIs through Scaffolding (Scaffold) in a Web Forms project, and developers can freely mix and choose the technology you want. One ASP. NET is the one ASP that makes it easier for developers to do what they want to do in their beloved ASP. NET should give developers confidence that whatever they choose, they are still developing under the-asp.net-of a trusted infrastructure framework.
The MVC project template seamlessly integrates into a new one ASP. NET experience. Through one ASP. NET, developers can create MVC projects and configuration certifications. MVC projects are now part of the standard Web application and no longer use their own project GUIDs.
VS2013 has EF6 inside.
EF6 in code First mode, Codefrist does not support more databases, such as the Access,sqlite,sql compact 3.5,mysql,oracle
MVC6
In the new version of Asp.net5 and MVC6, there are a lot of changes, some are radical changes, such as at the bottom of the support of dependency injection technology, for the convenience of understanding, we listed here the most important 10 major changes in order to learn, as follows:
The ASP. NET 5 is now cross-platform and can be run on Mac and Linux.
There is no longer a WEB Forms framework.
Only C # is supported, not vb.net supported. (seems to have recently heard that the final version of vb.net and support)
New TAG syntax, @Html. labelfor or html.textboxfor Replace with new syntax <label asp-for= "name" > or <input asp-for= "name"/> For model binding 。
The new view Component, which defines the local content as a separate component for invocation, is very similar to the WebControl in Web Forms.
Embrace the front-end technology with built-in Nodejs, NPM, Grunt, Bower technology.
Model integration, integrating MVC and WebAPI into one framework.
Support AngularJS, help built-in AngularJS module, controller, directive, and factory templates.
Supports dependency injection technology, has a native DI framework, and also supports third-party containers.
Supports xunit.net and discards the Visual Studio Unit testing Framework.
The MVC, Web API, Web Pages three frameworks in ASP. 5 are merged into a single frame, collectively known as MVC6. The merge will remove duplicate features from the three frameworks, such as MVC and the two controllers in the Web API that only hold one. But the functionality of traditional MVC is preserved, such as model binding. However, it is said that Web Pages will not be published in RTM, but will be published in the first update after RTM.
MVC6 introduces some new features, the most compelling feature being Tag Helpers and View components. Tag Helpers is a replacement for Html Helpers, and View components introduces the concept of WebControl in similar Web Forms.
EF7
EF7 is not updated on EF6, but is completely rewritten. It fully supports the. NET Core runtime, which means you can use EF on your Mac or Linux machine later on.
EF7 changes in larger ratios:
A. Support for Code-first or code only, no longer supports graphical interface generation.
B. Support relational database.
C. Cross-platform.
Microsoft is really 2!!! The update is too fast.
ASP. NET MVC different versions of EF