加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 页面生命周期中的哪个位置是母版页的加载事件(不是On

发布时间:2020-12-16 09:41:20 所属栏目:asp.Net 来源:网络整理
导读:我对页面生命周期的理解如下: Page Page_reInit MasterPage Page_Init Page PageInInit Page PageInInitComplete Page Page_PreLoad Page Page_Load MasterPage Page_Load Page_LoadComplete Page_PreRender MasterPage Page_PreRender Page Page_reRenderC
我对页面生命周期的理解如下:

> Page Page_reInit
> MasterPage Page_Init
> Page PageInInit
> Page PageInInitComplete
> Page Page_PreLoad
> Page Page_Load
> MasterPage Page_Load
> Page_LoadComplete
> Page_PreRender
> MasterPage Page_PreRender
> Page Page_reRenderComplete
> Page Page_SaveStateComplete
> MasterPage Page_Unload
> Page Page_Unload

鉴于上述情况,MasterPage的Load事件在哪里触发?谷歌没有帮助,因为很多人在谈论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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读