Mvc2 has been used in previous projects. Although mvc4 has already come out, it only has mvc3 books on hand. Simply learn MVC3.
Asp.net mvc 3 Overview
(1) friendly attempt to express, including the new Razor view Engine
(2) Support for. NET4 data Annotation
(3) improved model verification and funny verification Introduction
(4) strong association with Dependency Resolution and Global Action Filters
(5) rich JavaScript support, including non-intrusive JavaScript, jQuery verification, and JSON binding
(6) NuGet
Create an ASP. net mvc 3 Application
Create a new ASP. net mvc project:
(1) Select | new | select ASP. NET MVC3 Web application in the project dialog box, as shown in Figure 1-1:
(2) create a new ASP. net mvc 3 application, a temporary dialog box with specific options of MVC appears. In this dialog box, you can set most of the infrastructure of the application, from account management to view engine to test, if 1-2 is shown:
1. The three application templates are:
Empty template: most of the content of this template is empty, but the project still contains basic folders, CSS, and the basic structure of ASP. net mvc applications. In addition, there is no other content.
Internet Application Template: This template contains the startup method of ASP. net mvc Web application, and some pages. Includes basic account management functions for the asp.net Membership system.
Intranet application template: It is updated as part of the asp.net mvc tool in Tianjin. It is intended for Internet application templates, but its account management function is not for ASP. NET Membership is for Windows accounts.
2. View Engine
Razor is added to ASP. NET MVC3 in addition to ASPX. We will explain Razor in the future.
3. Test
You can create unit test projects.
Select an Internet Application Template and click OK to create an ASP. NET MVC application, as shown in figure 1-3:
Structure of ASP. net mvc applications
The asp.net mvc project contains six top-level directories by default, as shown in figure 1-4.