Control.OnLoad(EventArgs) Metoda

Definicja

Load Zgłasza zdarzenie.

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

Parametry

e
EventArgs

EventArgs Obiekt, który zawiera dane zdarzenia.

Przykłady

// 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

Uwagi

ASP.NET wywołuje tę metodę w Load celu zgłoszenia zdarzenia. Jeśli tworzysz kontrolkę niestandardową, możesz zastąpić tę metodę w celu zapewnienia dodatkowego przetwarzania. Jeśli zastąpisz tę metodę, wywołaj metodę kontrolki OnLoad podstawowej, aby powiadomić subskrybentów o zdarzeniu.

Dotyczy

Zobacz też