Asp.net MVC 3 instance learning extshop (1) ---- create an application and set the development environment

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.