The ASP. NET application adheres to the following 3 conventions:
- The names of all controllers end with a controller, such as HomeController, AccountController these classes default to the Controllers directory;
- All views of the application are placed in a separate view directory;
- The view used by the controller is in a subdirectory of the Views home directory, which is named according to the controller name (without the controllers).
For example: The default home page of the program is the index view returned by HomeController, the location of the view is:/views/home/index.cshtml
The ASP. NET MVC application is highly dependent on the conventions, and failure to comply with these conventions will cause errors.
Note:
- The MVC application puts the controller in the Controllers folder by default, but it can also be placed in a different folder;
- The view used by the controller can also be a view under the shared subdirectory;
The Conventions of ASP.