The little knowledge of MVC.

Source: Internet
Author: User

1. After compiling the foreground page of MVC, a foreground page class will also be generated. Add this code to the page the day before yesterday . GetType (). Assembly.getlocation () Gets the assembly where the current class is located, and can see the program it is in, and it will find out if the type view inherits the Webviewpage<object> The strong type is the strong type object of locomotive webviewpage<. This is why the model, can be the occasion. The reason for the corresponding attribute

2, When you start the MVC page, you will first find the _viewstart.cshtml under View and output its page code, under control to find out if there is _viewstart.cshtml , if there is the same output, the code in the current page is output. If the current page is Layout=null, the _viewstart.cshtml The layout code referenced in the. Layout is called the _layout.cshtml code under the Shred folder. _Layout.cshtml Such files can be more than one, implementing different global layout pages.

3, when the compilation starts MVC, first compiles the Global.asax, registers in the first pipeline event, registers the route in the seventh time, that is, matches the routing rule in that place. In the eighth event, the Remaphander property in the context of the monitoring is empty, and the next event is not empty. Invokes the corresponding action method in the controller between 11 and 12 events and executes

The little knowledge of MVC.

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.