Events on ASP. NET master pages and content pages

Source: Internet
Author: User

Both the master page and content page can contain the event processing of the control.Program. For controls, events are processed locally, that is, controls on the Content Page trigger events on the Content Page, and controls on the master page trigger events on the master page. Control events are not sent from the content page to the master page. Similarly, you cannot process events from the master page control in the Content Page.

In some cases, the same event is triggered on the Content Page and master page. For example, both triggers the init and load events. The general rule for triggering an event is that the initialization event is triggered from the innermost control to the outermost control, and all other events are triggered from the outermost control to the innermost control. Remember that the master page is merged into the content page and considered as a control in the content page, which is useful at 01:10.

The following shows the sequence of events after the master page and content page are merged:

  1. Master Page ControlInitEvent.

  2. Content ControlInitEvent.

  3. Master pageInitEvent.

  4. Content PageInitEvent.

  5. Content PageLoadEvent.

  6. Master pageLoadEvent.

  7. Content ControlLoadEvent.

  8. Content PagePrerenderEvent.

  9. Master pagePrerenderEvent.

  10. Master Page ControlPrerenderEvent.

  11. Content ControlPrerenderEvent.

The event sequence on the master page and content page is not important to page developers. However, if the event handler you create depends on the availability of some events, you will find it helpful to understand the event sequence on the master page and content page.

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.