The Conventions of ASP.

Source: Internet
Author: User

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:

    1. The MVC application puts the controller in the Controllers folder by default, but it can also be placed in a different folder;
    2. The view used by the controller can also be a view under the shared subdirectory;

The Conventions of ASP.

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.