Create an "extshop" project shown in 1 in vs2010, select "empty" in the window in Figure 2, and click "OK" to create the project, the directory structure of the project and the included file 3 are shown in.
Figure 1
Figure 2
Figure 3
The site.css file under the contentfile is the CSS file of the entire website. The script folder contains the jquery script file. The view directory contains four files. The _ viewstart. cshtml file specifies the master page for the page, and _ layout. cshtml is the default master page.
Open the _ viewstart. cshtml file and you can see the following:Code:
@ {Layout ="~ /Views/shared/_ layout. cshtml";}
The Code shows that the default master page of the view is the _ layout. cshtml file in the shared directory. If you want to use another master page as the master page, you can modify the file.
Open the _ layout. cshtml file and you can see the following code:
@ URL. Content ("~ /Content/site.css")"Rel ="Stylesheet"Type ="Text/CSS"/> @ Renderbody ()
From the code, you can see that in the master edition, the site.css file is included as the CSS file for all views. The main file of jquery is included in the master page. @ Renderbody () The position of the statement is where the page content is displayed.
Now we need to add a data model for the project. Select the models directory, right-click the menu, and select "new item" under the "add" menu. In the pop-up window shown in figure 4, select "data" on the left ", then, change the name of the "LINQ to SQL class" to "extshop" on the right, and click "add.
Figure 4
Click "server resource manager" to open the "server resource manager" window, select "Data Connection", and right-click, select "add connection" in the menu to create a connection to the "extshop" database. After the connection is created, open the "table" node, select all tables, drag the selected items to the Left window of extshop. dbml, and finally the result shown in Figure 5 is displayed.
Figure 5
In this way, the development framework is basically set up, and the details can be opened below.