ASP. net mvc (2)

Source: Internet
Author: User

I want to familiarize myself with the directory structure and dll of the ASP. NET MVC project.

 

1. directory structure of ASP. net mvc Project

App_Data: stores data files.

Content: it is recommended to put some resource files, such as Css and images. Of course, you can choose not to put any Content.

Controllers: We recommend that you put the Controllers classes in this directory for ease of management.

The Controller class name must end with the Controller

Models: classes that are recommended to store business entities and data access layers.

Scripts: stores JS files

Views: by default, View files must be stored in this directory. Each Controller corresponds to a sub-directory. Generally, each Action corresponds to a page.

There is also a Shared subdirectory under the Views Directory, which is used to store some Shared Views, such as Error. aspx and Site. Master. When the Controller cannot find the specified view in Views \ ControllerNmae, it will look for it in Shared.

 

2. Asp. NET core DLL

 

System. Web. Routing: URL routing. Routing a URL to the corresponding Controller depends on this. It is processed in HttpModule.

System. Web. Extensions: This is ASP. net ajax.

System. Web. Mvc: The main assembly of ASP. net mvc. This DLL is the source code released on CodePlex.

System. Web. Category actions: This Assembly comes from some related base classes. For example, HttpContextBase and HttpRequestBase.

In VS2008, you may need to manually add the DLL file. Here I will detail System. MVC

Open HomeController and you will see using Sytem. Web. Mvc. That is, when we create the Controol class, the reference will be automatically added to us. But how is it added?

HomeController

HomeController inherits Controller. F12 enters the Controller class and you can see

 

# Region assembly System. Web. Mvc. dll, v3.0.0.0

// E: \ NET \ classromm_test \ My_MVC \ packages \ Microsoft. AspNet. Mvc.3.0.20105.1 \ lib \ net40 \ System. Web. Mvc. dll

# Endregion

 

Check the path carefully. You are familiar with it. This is the path of the project. Now it is clear that when we create an MVC project, we will automatically copy the DLL files required by Mvc to the current project and add references automatically.

 

Okay, it's a rush to end. Think about what to eat at noon.

Related Article

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.