惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
Apple Machine Learning Research
Apple Machine Learning Research
L
LINUX DO - 最新话题
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
月光博客
月光博客
博客园 - 叶小钗
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
Tailwind CSS Blog
D
DataBreaches.Net
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog RSS Feed
量子位
美团技术团队
Vercel News
Vercel News
Y
Y Combinator Blog
IT之家
IT之家
Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
腾讯CDC
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
博客园 - 司徒正美
N
Netflix TechBlog - Medium
S
Schneier on Security
博客园 - 聂微东
U
Unit 42
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
Latest news
Latest news

博客园 - 眼里进了砂

Unity Application Block 1.2 学习笔记 [转] Unity Application Block 與 ASP.NET MVC 學習資源整理 [转] 线程之间的通讯---SynchronizationContext [转] .NET2.0中WinForm自定义的程序配置[转] 使用BackgroundWorker组件进行异步操作编程[转] 不用设置iis .net 实现urlrewrite[转] 利用XPath读取Xml文件 javascript中replace与正则表达式 c# BackgroundWorker组件介绍(属性、方法、事件) .net 2.0 BackgroundWorker类详细用法 .Net的线程同步方法一:ManualResetEvent .NET应用程序中异步调用Web Service的几种方法 come from: veryhappy(wx.net) [转][javascript] Google谷歌首页点点效果 AJAX 中Sys.WebForms.PageRequestManager的事件激发顺序 AJAX 中Sys.Net.WebRequestManager的事件激发顺序 Summary review about Problem.Design.Solution 2 Summary review about Problem.Design.Solution [转发]深入理解 __doPostBack CSS Tips
.NET页面事件执行顺序[转]
眼里进了砂 · 2009-05-19 · via 博客园 - 眼里进了砂

客户发出POST请求-〉创建Page派生类,调用构造函数-〉调用Page类的IHttpHandler.ProcessRequest

方法

-〉激活Page类的Init事件-〉调用Page类的CreateChildControls虚方法-〉从POST变量和VIEWSTATE中还原服务器端控件状态-〉激活Page类的Load事件-〉激活服务器端控件事件-〉激活Page类的PreRender事件-〉调用Page类的Render虚方法-〉调用Page类的RenderChildren虚方法-〉发送HTTP响应给

客户

端-〉激活Page类的Unload事件-〉丢弃Page派生类的实例。

Page 执行中将按照如下顺序激活事件:

Page.PreInit
Page.Init
Page.InitComplite
Page.PreLoad
Page.Load
Page.LoadComplete
Page.PreRender
Page.PreRenderComplete

如果页面从令一个页面继承,如BasePage:System.Web.UI.Page,在BasePage中做了一些扩展,如权限检查,而其他页面从BasePage继承,则BasePage和最终Page的事件激活顺序是:

UI.PreInit
Page.PreInit
UI.Init
Page.Init
UI.InitComplite
Page.InitComplite
UI.PreLoad
Page.PreLoad
UI.Load
Page.Load
UI.LoadComplete
Page.LoadComplete
UI.PreRender
Page.PreRender
UI.PreRenderComplete
Page.PreRenderComplete

如果使用了MasterPage,则MasterPage中的事件和ContentPage中的事件按照下面顺序激活:

ContentPage.PreInit
Master.Init
ContentPage.Init
ContentPage.InitComplite
ContentPage.PreLoad
ContentPage.Load
Master.Load
ContentPage.LoadComplete
ContentPage.PreRender
Master.PreRender
ContentPage.PreRenderComplete

更进一步,如果ContentPage继承BasePage,那么,各事件的执行顺序将变成:

UI.PreInit
ContentPage.PreInit
Master.Init
UI.Init
ContentPage.Init
UI.InitComplite
ContentPage.InitComplite
UI.PreLoad
ContentPage.PreLoad
UI.Load
ContentPage.Load
Master.Load
UI.LoadComplete
ContentPage.LoadComplete
UI.PreRender
ContentPage.PreRender
Master.PreRender
UI.PreRenderComplete
ContentPage.PreRenderComplete

ASP.NET 2.0 页面事件执行顺序

MasterPage.master

UserControl_OnTop.ascx

Page.aspx

UserControl_InPage.ascx

UserControl_OnButtom.ascx

MasterPage UserControlOnTop Page UserControlInPage UserControlOnButtom
Init
Init
Init
Init
Init
Load
Load
Load
Lod
Load
ControlEvents ControlEvents ControlEvents ControlEvents ControlEvents
PreRender
PreRender
PreRender
PreRender
PreRender
UnLoad
UnLoad
UnLoad
UnLoad
UnLoad