Select "new" from the File menu in Visual Studio and select "project.
Then, select the web template group in C #, select ASP. Net MVC 4 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.
Some basic naming conventions are used in ASP. net mvc.
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 also exist in an empty ASP. net mvc application, because the ASP. net mvc framework uses"Conventions are better than configurations"It has been assumed that these folders have a specific purpose. 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 detail these conventions.
Music Store episode 2nd: laying the foundation