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.