Page.OnInitComplete(EventArgs) 方法

定义

InitComplete在页面初始化后引发事件。

protected:
 virtual void OnInitComplete(EventArgs ^ e);
protected virtual void OnInitComplete(EventArgs e);
abstract member OnInitComplete : EventArgs -> unit
override this.OnInitComplete : EventArgs -> unit
Protected Overridable Sub OnInitComplete (e As EventArgs)

参数

e
EventArgs

包含事件数据的一个 EventArgs

注解

OnInitComplete 页面初始化完成后调用该方法。 在此页面生命周期的这一阶段中,页面上的所有声明控件都会初始化,但尚未填充页面的视图状态。 可以访问服务器控件,但它们尚不包含从用户返回的信息。

该方法 OnInitComplete 在初始化阶段的 Page 末尾和加载阶段之前发生。

引发事件会通过委托调用事件处理程序。 有关详细信息,请参阅 处理和引发事件

该方法 OnInitComplete 还允许派生类在不附加委托的情况下处理事件。 这是处理派生类中的事件的首选技术。

继承者说明

在派生类中重写 OnInitComplete(EventArgs) 时,请务必调用基类的方法,以便已注册的 OnInitComplete(EventArgs) 委托接收事件。

适用于