Select "new" from the File menu in Visual Studio and select "project.
Then, select the Web template group in C #, select ASP. NET MVC3 Web application in the Project template on the right, enter MvcMusicStore in the project name input box, and click OK.
At this time, you will go to the second dialog box, allowing us to set some settings for the project about MVC, confirm that the "null" Project template is selected, the view engine selects Razor, and click OK.
In this way, the project is successfully created!
Let's take a look at what has been created in this project.
The following basic naming conventions are used in ASP. net mvc: www.2cto.com
Folder |
Function |
/Controllers |
The Controller accepts requests from the browser for processing and then returns a response to the user. |
/Views |
View folder to save the User Interface Template |
/Models |
This folder defines the processed data |
/Content |
Put our images, CSS and any other static content here |
/Scripts |
Place script files |
/App_Data |
Database Files |
These folders are stored in an empty ASP. net mvc application also exists, because ASP. by default, the framework of net mvc uses the "Convention is better than configuration" principle. It has been assumed that these folders have specific purposes. For example, the Controller will find the corresponding view in the Views folder, without explicitly setting it in the code, which can save a lot of programming work, it also makes it easier for other developers to understand your program. During the process of creating this program, we will describe these conventions in detail.
From champion