当前位置: 动力学知识库 > 问答 > 编程问答 >

asp.net - Where in the page life cycle is the master page's load event (not OnLoad nor Page_Load)?

问题描述:

My understanding of the page life cycle is as follows:

  1. Page Page_PreInit

  2. MasterPage Page_Init

  3. Page Page_Init

  4. Page Page_InitComplete

  5. Page Page_PreLoad

  6. Page Page_Load

  7. MasterPage Page_Load

  8. Page_LoadComplete

  9. Page_PreRender

  10. MasterPage Page_PreRender

  11. Page Page_PreRenderComplete

  12. Page Page_SaveStateComplete

  13. MasterPage Page_Unload

  14. Page Page_Unload

Given the above, where does the MasterPage's Load event fire? Google isn't helping as quite a lot of people say Load when talking about the OnLoad event.

网友答案:

Master Page load event is between Content page Load event and Master page controls Load event.

Check the MSDN for details

Although both Init and Load recursively occur on each control, they happen in reverse order. The Init event (and also the Unload event) for each child control occur before the corresponding event is raised for its container (bottom-up). However the Load event for a container occurs before the Load events for its child controls (top-down). Master pages behave like child controls on a page: the master page Init event occurs before the page Init and Load events, and the master page Load event occurs after the page Init and Load events.

MSDN

分享给朋友:
您可能感兴趣的文章:
随机阅读: