ASP.NET中页面及用户控件的事件执行顺序
2010-04-13 10:53
417 查看
转贴:http://www.yaosansi.com/post/893.html
在WebForm1页面上直接放置用户控件WebUserControl1时的事件顺序: WebUserControl1_Init
WebForm1_Init
Page_Load
WebUserControl1_Load
WebForm1_PreRender
WebUserControl1_PreRender
WebUserControl1_Unload
WebForm1_Unload
在WebForm1页面的OnInit方法中用代码Load用户控件WebUserControl1时的事件顺序:
WebForm1_Init : OnInit WebForm1: Loading controls WebUserControl1_Init : OnInit WebForm1: added to Controls WebForm1: LoadViewState WebUserControl1: LoadViewState WebUserControl1: LoadPostData Begin WebUserControl1: LoadPostData End WebForm1_PageLoad: OnLoad after base's Onload. WebUserControl1_Load: after base's OnLoad iWebUserControl1: RaisePostDataChange WebForm1: OnPreRender WebUserControl1: OnPreRender WebForm1: SavedViewState WebUserControl1: SaveViewState
在WebForm1页面的Page_Load方法中用代码Load用户控件WebUserControl1时的事件顺序:
WebForm1_Init : OnInit WebForm1: LoadViewState WebForm1_PageLoad: OnLoad after base's Onload. WebForm1: Loading controls WebUserControl1_Init : OnInit WebUserControl1: LoadViewState WebForm1: added to Controls WebUserControl1_Load: after base's OnLoad WebUserControl1: LoadPostData Begin WebUserControl1: LoadPostData End iWebUserControl1: RaisePostDataChange WebForm1: OnPreRender WebUserControl1: OnPreRender WebForm1: SavedViewState WebUserControl1: SaveViewState
在WebForm1页面的Button1_Click事件中用代码Load用户控件WebUserControl1时的事件顺序:
WebForm1_Init
Page_Load
Button1_Click
WebUserControl1_Init
WebUserControl1_Load
WebForm1_PreRender
WebUserControl1_PreRender
WebUserControl1_Unload
WebForm1_Unload
在WebForm1页面的Page_Load事件中用代码Load用户控件WebUserControl1,
WebUserControl1又在Page_Load事件中用代码Load用户控件WebUserControl2时的事件顺序:
WebForm1_Init
Page_Load
WebUserControl1_Init
WebUserControl1_Load
WebUserControl2_Init
WebUserControl2_Load
WebForm1_PreRender
WebUserControl1_PreRender
WebUserControl2_PreRender
WebUserControl2_Unload
WebUserControl1_Unload
WebForm1_Unload
在WebForm1页面上直接放置用户控件WebUserControl1时的事件顺序: WebUserControl1_Init
WebForm1_Init
Page_Load
WebUserControl1_Load
WebForm1_PreRender
WebUserControl1_PreRender
WebUserControl1_Unload
WebForm1_Unload
在WebForm1页面的OnInit方法中用代码Load用户控件WebUserControl1时的事件顺序:
WebForm1_Init : OnInit WebForm1: Loading controls WebUserControl1_Init : OnInit WebForm1: added to Controls WebForm1: LoadViewState WebUserControl1: LoadViewState WebUserControl1: LoadPostData Begin WebUserControl1: LoadPostData End WebForm1_PageLoad: OnLoad after base's Onload. WebUserControl1_Load: after base's OnLoad iWebUserControl1: RaisePostDataChange WebForm1: OnPreRender WebUserControl1: OnPreRender WebForm1: SavedViewState WebUserControl1: SaveViewState
在WebForm1页面的Page_Load方法中用代码Load用户控件WebUserControl1时的事件顺序:
WebForm1_Init : OnInit WebForm1: LoadViewState WebForm1_PageLoad: OnLoad after base's Onload. WebForm1: Loading controls WebUserControl1_Init : OnInit WebUserControl1: LoadViewState WebForm1: added to Controls WebUserControl1_Load: after base's OnLoad WebUserControl1: LoadPostData Begin WebUserControl1: LoadPostData End iWebUserControl1: RaisePostDataChange WebForm1: OnPreRender WebUserControl1: OnPreRender WebForm1: SavedViewState WebUserControl1: SaveViewState
在WebForm1页面的Button1_Click事件中用代码Load用户控件WebUserControl1时的事件顺序:
WebForm1_Init
Page_Load
Button1_Click
WebUserControl1_Init
WebUserControl1_Load
WebForm1_PreRender
WebUserControl1_PreRender
WebUserControl1_Unload
WebForm1_Unload
在WebForm1页面的Page_Load事件中用代码Load用户控件WebUserControl1,
WebUserControl1又在Page_Load事件中用代码Load用户控件WebUserControl2时的事件顺序:
WebForm1_Init
Page_Load
WebUserControl1_Init
WebUserControl1_Load
WebUserControl2_Init
WebUserControl2_Load
WebForm1_PreRender
WebUserControl1_PreRender
WebUserControl2_PreRender
WebUserControl2_Unload
WebUserControl1_Unload
WebForm1_Unload
相关文章推荐
- ASP.NET中页面及用户控件的事件执行顺序
- ASP.Net 母版、页面、用户控件事件的执行顺序
- asp.net页面装载用户控件时的事件顺序
- ASP.NET页面上直接放置用户控件WebUserControl1时的事件顺序
- ASP.NET页面事件过程-多个用户控件时的执行过程
- ASP.NET用户控件操作ASPX页面(在ASPX页面捕捉用户控件的事件)
- asp.net页面事件执行顺序
- asp.net 页面从初始化到卸载事件顺序(及对页面控件调用)完整列表【转】
- ASP.NET 页面事件执行顺序介绍
- asp.net页面事件执行顺序
- 引用asp.net母版页后,母版页和内容页的页面事件执行顺序
- asp.net页面事件执行顺序
- ASP.net中页面事件的先后执行顺序
- asp.net页面生命周期事件执行顺序
- asp.net页面事件执行顺序(轉)
- asp.net页面事件执行顺序
- asp.net页面事件执行顺序(转)
- asp.net页面事件执行顺序
- asp.net页面事件执行顺序