In what order asp.net master pages execute

后端 未结 2 419
野性不改
野性不改 2021-01-07 00:37

I m using master page in my project. I want to know the order in which the page loads of both master page and web page executes also about the scripts

相关标签:
2条回答
  • 2021-01-07 00:53

    From: https://msdn.microsoft.com/en-us/library/dct97kc3.aspx

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

    1. Content page PreInit event.
    2. Master page controls Init event.
    3. Content controls Init event.
    4. Master page Init event.
    5. Content page Init event.
    6. Content page Load event.
    7. Master page Load event.
    8. Master page controls Load event.
    9. Content page controls Load event.
    10. Content page PreRender event.
    11. Master page PreRender event.
    12. Master page controls PreRender event.
    13. Content page controls PreRender event.
    14. Master page controls Unload event.
    15. Content page controls Unload event.
    16. Master page Unload event.
    17. Content page Unload event.
    0 讨论(0)
  • 2021-01-07 01:06
    1. Master page child controls initialization: All server controls contained within the master page are first initialized.
    2. Content page child controls initialization: All server controls contained in the content page are initialized.
    3. Master page initialization: The master page itself is initialized.
    4. Content page initialization: The content page is initialized.
    5. Content page load: The content page is loaded (this is the Page_Load event followed by the Page_LoadComplete event).
    6. Master page load: The master page is loaded (this is also the Page_Load event).
    7. Master page child controls load: The server controls on the master page are loaded onto the page.
    8. Content page child controls load: The server controls on the content page are loaded onto the page.

    http://it.toolbox.com/blogs/coding-dotnet/events-in-master-page-content-pages-16262

    0 讨论(0)
提交回复
热议问题