Page.OnInitComplete(EventArgs) 方法
定义
在页初始化后引发 InitComplete 事件。Raises the InitComplete event after page initialization.
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)
参数
注解
在 OnInitComplete 页初始化完成后调用方法。The OnInitComplete method is called after page initialization is complete. 在此页的生命周期的这一阶段,该页上的所有已声明控件都将初始化,但尚未填充该页的视图状态。In this stage of the page's life cycle, all declared controls on the page are initialized, but the page's view state is not yet populated. 您可以访问服务器控件,但它们将不包含从用户返回的信息。You can access server controls, but they will not yet contain information returned from the user.
OnInitComplete方法在 Page 初始化阶段结束时、加载阶段之前发生。The OnInitComplete method occurs at the end of the Page initialization stage and before the load stage.
引发事件时,将通过委托调用事件处理程序。Raising an event invokes the event handler through a delegate. 有关详细信息,请参阅 处理和引发事件。For more information, see Handling and Raising Events.
OnInitComplete 方法还允许派生类对事件进行处理而不必附加委托。The OnInitComplete method also allows derived classes to handle the event without attaching a delegate. 这是在派生类中处理事件的首选技术。This is the preferred technique for handling the event in a derived class.
继承者说明
在派生类中重写 OnInitComplete(EventArgs) 时,一定要调用基类的 OnInitComplete(EventArgs) 方法,以便已注册的委托对事件进行接收。When overriding OnInitComplete(EventArgs) in a derived class, be sure to call the base class's OnInitComplete(EventArgs) method so that registered delegates receive the event.