UserControl.OnInit(EventArgs) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
引發 Init 事件。
protected:
override void OnInit(EventArgs ^ e);
protected public:
override void OnInit(EventArgs ^ e);
protected override void OnInit(EventArgs e);
protected internal override void OnInit(EventArgs e);
override this.OnInit : EventArgs -> unit
Protected Overrides Sub OnInit (e As EventArgs)
Protected Friend Overrides Sub OnInit (e As EventArgs)
參數
備註
當此方法通知後,必須 UserControl 執行建立並設定實例所需的初始化步驟。 此方法確認與實例相關的 UserControl 站點資訊,並確保類別正確初始化為 UserControl 物件。
在使用者控制項生命週期的這個階段,控制項的視圖狀態尚未被填入。 此外,當呼叫此方法時,無論該方法是子控制還是父,你都無法存取其他伺服器控制項。 其他伺服器控制權則不確定是否會被建立並準備好存取。