Html32TextWriter.RenderAfterTag Méthode

Définition

Écrit l'espacement ou le texte survenant après la balise de fermeture d'un élément HTML.

protected:
 override System::String ^ RenderAfterTag();
protected override string RenderAfterTag ();
override this.RenderAfterTag : unit -> string
Protected Overrides Function RenderAfterTag () As String

Retours

String

L'espacement ou le texte à écrire à la suite de la balise de fermeture de l'élément HTML ; sinon, en l'absence de telles informations à restituer, null.

Exemples

L’exemple de code suivant montre comment remplacer la RenderAfterTag méthode. Le code vérifie si un a élément est rendu. Si tel est le cas, la RenderAfterTag méthode écrit la balise de fermeture d’un small élément. L’exemple de la RenderBeforeTag méthode effectue la même vérification de l’élément a , puis écrit la balise d’ouverture de l’élément small .

Cet exemple de code fait partie d’un exemple plus grand fourni pour la Html32TextWriter classe.

// Override the RenderAfterTag method to render
// close any elements opened in the RenderBeforeTag
// method call.
protected override string RenderAfterTag()
{
    // Check whether the element being rendered is an
    // <a> element. If so, render the closing tag of the
    // <small> element; otherwise, call the base method.
    if (TagKey == HtmlTextWriterTag.A)
        return "</small>";
    return base.RenderAfterTag();
}
' Override the RenderAfterTag method to render
' close any elements opened in the RenderBeforeTag
' method call.
Protected Overrides Function RenderAfterTag() As String
    ' Check whether the element being rendered is an
    ' <a> element. If so, render the closing tag of the
    ' <small> element; otherwise, call the base method.
    If TagKey = HtmlTextWriterTag.A Then
        Return "</small>"
    End If
    Return MyBase.RenderAfterTag()
End Function

S’applique à

Voir aussi