Html32TextWriter.RenderAfterTag Méthode
Définition
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.
Écrit tout espacement ou texte qui se produit 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
Espacement ou texte à écrire après la balise de fermeture de l’élément HTML ; sinon, s’il n’existe aucune information de ce type à afficher, null.
Exemples
L’exemple de code suivant montre comment remplacer la RenderAfterTag méthode. Le code vérifie si un a élément est affiché. Si c’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