asp.net: what#39;s the page life cycle order of a control/page compared to a user contorl inside it?(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:与其中的用户控件相比,控件/页面的页面生命周期顺序是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:asp.net:与其中的用户控件相比,控件/页面的页面生命周期顺序是什么?


基础教程推荐
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01