Ocean studio-website construction expert: Events in ASP. NET master and content pages

Source: Internet
Author: User
Both master pages and content pages can contain Event Handlers for controls. for controls, events are handled locally-A control in a content page raises an event in the content page, and a control in the master page raises an event in the master page. controls events are not sent from the content page to the master page. similarly, you cannot handle an event from a master page control in a content page.

In some cases, the same event is raised in both the content and the master page. For example, both pages raiseInitAndLoadEvents. the general rule for how events are raised is that the initialization events are raised from the innermost control to the outermost one, and all other events are raised from the outermost control to the innermost one. it is helpful to remember that the master page is merged into the content page and treated as a control in the content page.

The following is the sequence in which events occur when a master page is merged with a content page:

  1. Content PagePreinitEvent.

  2. Master page controlsInitEvent.

  3. Content controlsInitEvent.

  4. Master pageInitEvent.

  5. Content PageInitEvent.

  6. Content PageLoadEvent.

  7. Master pageLoadEvent.

  8. Master page controlsLoadEvent.

  9. Content Page controlsLoadEvent.

  10. Content PagePrerenderEvent.

  11. Master pagePrerenderEvent.

  12. Master page controlsPrerenderEvent.

  13. Content Page controlsPrerenderEvent.

  14. Master page controlsUnloadEvent.

  15. Content Page controlsUnloadEvent.

  16. Master pageUnloadEvent.

  17. Content PageUnloadEvent.

The sequence of events in master and content pages rarely is important for you as page developer. however, if you are creating event handlers that depend on the availability of certain controls, you will find it helpful to understand the Event Sequence in master and content pages.

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.