简体   繁体   English

ASP.NET页面创建的事件序列

[英]Event Sequence on ASP.NET page creation

I'm looking for a good tutorial/article that explains the exact sequence of events that takes place when a page is created. 我正在寻找一个很好的教程/文章,解释创建页面时发生的事件的确切顺序。 I can never remember the order. 我永远不记得订单。 I think it's something like the parent controls Init event is called, then the child controls Init event is called, in order of the placement on the page. 我认为它类似于调用父控件的Init事件,然后按照页面上的位置顺序调用子控件Init事件。 Also, when the control events are called, what order are they called in? 此外,当调用控件事件时,他们调用了什么顺序? For example, if a button event is raised, does this event get called before a DataList_ItemDataBound event is called if the DataList.DataBind is in the Page_Load event? 例如,如果引发了一个按钮事件,如果DataList.DataBind在Page_Load事件中,那么在调用DataList_ItemDataBound事件之前是否会调用此事件? So, does anyone want to try to explain or direct me to a nice article that explains all this? 那么,有没有人想尝试解释或指导我一篇解释这一切的好文章?

thanks. 谢谢。

此链接应涵盖它: MSDN页面生命周期

Maybe you're looking for this: 也许你正在寻找这个: 替代文字

by Leon Andrianarivony. 作者:Leon Andrianarivony。

This is a good article I refer to for these types of questions. 对于这些类型的问题,这是一篇很好的文章。

http://www.aspfree.com/c/a/ASP.NET/ASP.NET-Life-Cycle-and-Best-Practices/ http://www.aspfree.com/c/a/ASP.NET/ASP.NET-Life-Cycle-and-Best-Practices/

And to answer your question specifically - Button events run after everything in Page Load is completed so if you're calling a DataBind in Page_Load, the button click event comes after that. 并专门回答你的问题 - 按钮事件在页面加载中的所有内容完成后运行,因此如果您在Page_Load中调用DataBind,则会在此之后发生按钮单击事件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM