asp.net:与其中的用户控件相比,控件/页面的页面生命周期顺序是什么? [英] asp.net: what's the page life cycle order of a control/page compared to a user contorl inside it?

查看:17
本文介绍了asp.net:与其中的用户控件相比,控件/页面的页面生命周期顺序是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 aspx,里面有一个 ascx.通过简短的测试,我看到 aspx 的 PageLoad 在用户控件的 PageLoad 之前被调用,但 OnInit 的情况正好相反.

I have an aspx and inside it an ascx. From a short testing I see the PageLoad of the aspx is called before the PageLoad of the user-Control but the opposite is true for OnInit.

有人知道事件的顺序是什么(页面与其中的用户控件相比)

Does someone know what is the order of the events (page compared to a user-control inside it)

谢谢

推荐答案

你应该看看这个ASP.NET 页面生命周期概述这个

页面:预初始化
控制:初始化
页面:初始化
页面:初始化完成
页面:预加载
页面:加载
控制:加载
页面:加载完成
页面:预渲染
控制:预渲染
页面:PreRenderComplete
页面:SaveStateComplete
页面:渲染控制
页面:渲染
控制:渲染控制
控制:卸载
控制:处置
页面:卸载
页面:处理

Page: PreInit
Control: Init
Page: Init
Page: InitComplete
Page: PreLoad
Page: Load
Control: Load
Page: LoadComplete
Page: PreRender
Control: PreRender
Page: PreRenderComplete
Page: SaveStateComplete
Page: RenderControl
Page: Render
Control: RenderControl
Control: Unload
Control: Dispose
Page: Unload
Page: Dispose

这篇关于asp.net:与其中的用户控件相比,控件/页面的页面生命周期顺序是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆