1. File-> Create a project
Software Installation
This article uses free Visual Web Developer 2010Express to create ASP. NET MVC3, and gradually add some functions to create a complete application. Next, it will involve database access, form design, data verification, and unified layout using master pages, use AJAX technology to update and verify pages, and log on to users.
You can follow the steps below to download the full application from the http://mvcmusicstore.codeplex.com.
You can use VIsual Studio 2010 SP1 or Visual Web Developer 2010 Express SP1 (Visual Studio 2010 free version) to create a project. We will use SQL ServerCompact (free version) to deploy the database. Before you start, confirm that you have installed the following software. you can install the software from Web Platform Installer:
Link: http://www.microsoft.com/web/gallery/install.aspx? Appid = VWD2010SP1Pack
NOTE: you can find the following green button, link: http://asp.net/mvc
Web Platform Installer will check whether you have installed and downloaded the software you need
If you want to install the software independently, click the following link:
- Visual Studio Web Developer Express SP1 prerequisites
Http://www.microsoft.com/web/gallery/install.aspx? Appid = VWD2010SP1Pack
- ASP. net mvc 3 Tools Update
Http://www.microsoft.com/web/gallery/install.aspx? Appid = MVC3
- SQL Server Compact 4.0-including both runtime and tools support
Http://www.microsoft.com/web/gallery/install.aspx? Appid = SQLCE; SQLCEVSTools_4_0
Note: If you use Visual Studio 2010 instead of Visual Web Developer 2010, you must install the following software:
Visual Studio Web Developer Express SP1 prerequisites
Http://www.microsoft.com/web/gallery/install.aspx? Export xml = & appid = VS2010SP1Pack
I strongly recommend that you use Web Platform Installer to install these programs so that everything can be correctly installed.
Create a new MVC3 Application
The new project dialog box is displayed.
Select C #-> Web template on the left, select "ASP. net mvc 3 Web Application" in the middle, enter the Application name "MvcMusicStore", and click "OK ".
Next, a second-level dialog box is displayed. We need to make some MVC-specific settings for the project. Select the following settings.
- Project Template-select Empty
- View Engine-select Razor
- Use HTML5 semantic markup-selected
Check whether your settings are shown as follows, and then click "OK ".
This will create our project. Next, we will see that the folder has been added to the project in Solution Explorer on the right.
The MVC3 empty template is not empty because it has added some basic folder structures to the project:
ASP. NET uses some basic conventions for naming folders.
Folder |
Purpose |
/Controllers |
The Controller accepts the request from the browser, processes the request, and then returns the request to the user. |
/Views |
In the view, our Interface Template is saved. |
/Models |
Save the processed data |
/Script |
Store JavaScript files |
These folders are stored in an empty ASP. net mvc application will also be included, because ASP. by default, the framework of net mvc uses the principle that "conventions are better than configurations". These folders have specific purposes. For example, the controller looks for the corresponding view in views, but these do not need to be explicitly controlled in the Code. sticking to this Convention can save programming work, it also makes it easier for others to understand your code. We will describe these conventions in detail.