After we create a new ASP. NET MVC Web application, by default, the project directory structure is as follows:
- App_Data : This directory is the same as our general ASP. NET website, for storing data.
- content : This directory is recommended for storing resource files. such as CSS, JS, pictures and so on. Of course, if you don't want to, you can totally not put it here.
- Controllers : This directory is recommended to put the controller class here, easy to manage. The name of the Controller class must end with a controller, for example, a controller named home is named HomeController.
- Models : This directory is a class that is recommended for storing your business entities, data access layer code. Of course, the better way I think it should be to separate the models into a class library.
- Views: By default , all view files must be placed in this directory, each controller corresponds to a subdirectory, and the name of the subdirectory must be named the controller. For example, the HomeController view should be placed in the home subdirectory. We see 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 the Views\controllernmae, it goes to Gkfx to find it.
Let's take a look at ASP. NET MVC comparison core DLL, see the Red box section:
System.Web.Routing : URL routing. This is the way to route a URL to the corresponding controller. is dealt with in HttpModule.
System.Web.Extensions : This is ASP. NET AJAX.
SYSTEM.WEB.MVC: The most important assembly for ASP. It is this DLL that releases the source code on the CodePlex.
System.Web.Abstractions : This assembly is a collection of related base classes. such as HttpContextBase, Httprequestbase and so on.
MiCrosoft. WEB.MVC : This assembly simply puts in some MVC features and extended methods. In the ASP. NET MVC Beta, this DLL has been removed, but if you need the functionality of this DLL, you can download it here and introduce it.
We can build a generic webappliction in the VS08, and then introduce these DLLs, and then configure the Web. config file, then you can become an ASP. NET MVC application.
Go Introduction to ASP. 2, the directory structure of the project and the core DLL