zoukankan      html  css  js  c++  java
  • asp.net页面装载用户控件时的事件顺序

    在WebForm1页面上直接放置用户控件WebUserControl1时的事件顺序:
    WebUserControl1_Init <br>
    WebForm1_Init <br>
    Page_Load <br>
    WebUserControl1_Load <br>
    WebForm1_PreRender <br>
    WebUserControl1_PreRender <br>
    WebUserControl1_Unload <br>
    WebForm1_Unload <br>

    在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 <br>
    Page_Load <br>
    Button1_Click <br>
    WebUserControl1_Init <br>
    WebUserControl1_Load <br>
    WebForm1_PreRender <br>
    WebUserControl1_PreRender <br>
    WebUserControl1_Unload <br>
    WebForm1_Unload <br>

    在WebForm1页面的Page_Load事件中用代码Load用户控件WebUserControl1,WebUserControl1又在Page_Load事件中用代码Load用户控件WebUserControl2时的事件顺序:
    WebForm1_Init <br>
    Page_Load <br>
    WebUserControl1_Init <br>
    WebUserControl1_Load <br>
    WebUserControl2_Init <br>
    WebUserControl2_Load <br>
    WebForm1_PreRender <br>
    WebUserControl1_PreRender <br>
    WebUserControl2_PreRender <br>
    WebUserControl2_Unload <br>
    WebUserControl1_Unload <br>
    WebForm1_Unload <br>

  • 相关阅读:
    WPF数据绑定之4种绑定模式
    MVVM弹出提示
    MVVM 事件汇总
    C#读取数据库返回泛型集合 把DataSet类型转换为List泛型集合
    WINFORM 父窗体Load事件中打开子窗体并关闭自身
    常用正则表达式
    GridView密技#3GridView合并储存格后,隔列变底色(AlternatingRowStyle)
    自己动手写的版本 网站的 Detail程序 (DataReader)
    [入门] 双重关联 下拉式选单(DropDownList)
    GridView密技#2GridView合并储存格
  • 原文地址:https://www.cnblogs.com/tanbin1766/p/3118105.html
Copyright © 2011-2022 走看看