Control.OnPreRender(EventArgs) Method

Definition

Déclenche l'événement PreRender.Raises the PreRender event.

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

Parameters

e
EventArgs

Objet EventArgs qui contient les données d'événement.An EventArgs object that contains the event data.

Examples

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

Remarks

ASP.NET appelle cette méthode pour déclencher l’événement PreRender.ASP.NET calls this method to raise the PreRender event. Si vous développez un contrôle personnalisé, vous pouvez substituer cette méthode afin de fournir un traitement supplémentaire.If you are developing a custom control, you can override this method in order to provide additional processing. Si vous substituez cette méthode, appelez la méthode OnPreRender du contrôle de base pour notifier les abonnés à l’événement.If you override this method, call the base control's OnPreRender method to notify subscribers to the event.

Applies to

See also