gpt4 book ai didi

asp.net - 母版页的加载事件位于页面生命周期的哪个位置(不是 OnLoad 也不是 Page_Load)?

转载 作者:行者123 更新时间:2023-12-02 10:17:51 24 4
gpt4 key购买 nike

我对页面生命周期的理解如下:

  1. 页面 Page_PreInit

  2. MasterPage Page_Init

  3. 页面Page_Init

  4. 页面Page_InitComplete

  5. 页面Page_PreLoad

  6. 页面Page_Load

  7. MasterPage Page_Load

  8. Page_LoadComplete

  9. Page_PreRender

  10. MasterPage Page_PreRender

  11. 页面Page_PreRenderComplete

  12. 页面Page_SaveStateComplete

  13. MasterPage Page_Unload

  14. 页面Page_Unload

鉴于上述情况,MasterPage 的 Load 事件在哪里触发? Google 并没有提供帮助,因为很多人在谈论 OnLoad 事件时都会说“Load”。

最佳答案

母版页加载事件位于内容页加载事件和母版页控件加载事件之间。

检查MSDN了解详情

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

关于asp.net - 母版页的加载事件位于页面生命周期的哪个位置(不是 OnLoad 也不是 Page_Load)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29782074/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com