1 Asp.net用户控件和委托事件
参考文章链接:
http://www.cnblogs.com/scy251147/archive/2013/10/31/3398808.html
这篇文章主要讲的是利用委托事件 进行传参 。
2事件接口
链接地址;
http://www.cnblogs.com/insus/archive/2011/12/12/2284382.html
3 ASP.NET中页面及用户控件的事件执行顺序
1 在WebForm1页面上直接放置用户控件WebUserControl1时的事件顺序:
- WebUserControl1_Init
- WebForm1_Init
- Page_Load
- WebUserControl1_Load
- WebForm1_PreRender
- WebUserControl1_PreRender
- WebUserControl1_Unload
- WebForm1_Unload
2 在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
3 在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
4 在WebForm1页面的Button1_Click事件中用代码Load用户控件WebUserControl1时的事件顺序:
- WebForm1_Init
- Page_Load Button1_Click
- WebUserControl1_Init
- WebUserControl1_Load
- WebForm1_PreRender
- WebUserControl1_PreRender
- WebUserControl1_Unload
- WebForm1_Unload
5 在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
4 Asp.net 页面加载顺序
参考文献地址1:Asp.net 页面加载顺序及常用页面事件规律
参考文献地址2:关于asp.net中页面事件加载的先后顺序