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:与其中的用户控件相比,控件/页面的页面生命周期顺序是什么?
基础教程推荐
- C# 从 List<List<int>> 中删除重 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- WPF 模态进度窗口 2022-01-01
