Control.OnLoad(EventArgs) Control.OnLoad(EventArgs) Control.OnLoad(EventArgs) Control.OnLoad(EventArgs) Method

定义

引发 Load 事件。Raises the Load event.

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

参数

e
EventArgs EventArgs EventArgs EventArgs

包含事件数据的 EventArgs 对象。The EventArgs object that contains the event data.

示例

// Override the OnLoad method to set _text to
// a default value if it is null.
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    if (_text == null)
        _text = "Here is some default text.";
}
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
    MyBase.OnLoad(e)
    If _text Is Nothing Then
        _text = "Here is some default text."
    End If
End Sub

注解

ASP.NET 调用此方法来引发Load事件。ASP.NET calls this method to raise the Load event. 如果要开发自定义控件,则可以重写此方法,以便提供其他处理。If you are developing a custom control, you can override this method in order to provide additional processing. 如果重写此方法,请调用基控件的OnLoad方法以通知订阅者事件。If you override this method, call the base control's OnLoad method to notify subscribers to the event.

适用于

另请参阅