Control.OnLoad(EventArgs) Méthode
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Déclenche l’événement Load.
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)
// 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 appelle cette méthode pour déclencher l’événement Load . Si vous développez un contrôle personnalisé, vous pouvez remplacer cette méthode afin de fournir un traitement supplémentaire. Si vous remplacez cette méthode, appelez la méthode du contrôle de OnLoad base pour avertir les abonnés de l’événement.
Produit | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires: