共用方式為


BaseValidator.OnInit(EventArgs) 方法

定義

引發 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)

參數

e
EventArgs

EventArgs A 包含事件資料。

備註

此方法呼叫基礎控制OnInit項的方法後,若以下條件成立,則會將屬性ForeColor設定為:Red

此方法同時在頁面上註冊驗證控制。

給繼承者的注意事項

在導出類別中覆寫 OnInit(EventArgs) 時,務必呼叫基底類別的方法 OnInit(EventArgs) ,讓註冊代理接收事件。

適用於

另請參閱