开发者

In what order asp.net master pages execute

I m using master page in my project. I want to know t开发者_运维知识库he order in which the page loads of both master page and web page executes also about the scripts


  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


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜