HtmlTextWriter.RenderAfterTag メソッド
アセンブリ: System.Web (system.web.dll 内)

Dim returnValue As String returnValue = Me.RenderAfterTag
要素の終了タグの後に書き込む空白文字またはテキスト。

RenderAfterTag メソッドは、要素タグの後に終了タグを追加して出力する場合に便利です。
継承時の注意 HtmlTextWriter クラスで実装されている RenderAfterTag メソッドは、null 参照 (Visual Basic では Nothing) を返します。要素の終了タグの後にテキストまたは空白文字を書き込む場合は、RenderAfterTag をオーバーライドします。
RenderAfterTag メソッドをオーバーライドして、HtmlTextWriter クラスから派生したクラスが <label> 要素を出力するかどうかを確認する方法を次のコード例に示します。出力する場合は、RenderAfterTag オーバーライドが <label> 要素の直後に、<font> 要素の終了タグを挿入します。<label> 要素でない場合は、RenderAfterTag 基本メソッドが使用されます。
' Override the RenderAfterTag method to add the ' closing tag of the Font element after the ' closing tag of a Label element has been rendered. Protected Overrides Function RenderAfterTag() As String ' Compare the TagName property value to the ' string label to determine whether the element to ' be rendered is a Label. If it is a Label, ' the closing tag of a Font element is rendered ' after the closing tag of the Label element. If String.Compare(TagName, "label") = 0 Then Return "</font>" ' If a Label is not being rendered, use ' the base RenderAfterTag method. Else Return MyBase.RenderAfterTag() End If End Function 'RenderAfterTag End Class 'htwFour
// Override the RenderAfterTag method to add the // closing tag of the Font element after the // closing tag of a Label element has been rendered. protected override string RenderAfterTag() { // Compare the TagName property value to the // string label to determine whether the element to // be rendered is a Label. If it is a Label, // the closing tag of a Font element is rendered // after the closing tag of the Label element. if (String.Compare(TagName, "label") == 0) { return "</font>"; } // If a Label is not being rendered, use // the base RenderAfterTag method. else { return base.RenderAfterTag(); } }
// Override the RenderAfterTag method to add the // closing tag of the Font element after the // closing tag of a Label element has been rendered. virtual String^ RenderAfterTag() override { // Compare the TagName property value to the // String* label to determine whether the element to // be rendered is a Label. If it is a Label, // the closing tag of a Font element is rendered // after the closing tag of the Label element. if ( String::Compare( TagName, "label" ) == 0 ) { return "</font>"; } // If a Label is not being rendered, use // the base RenderAfterTag method. else { return __super::RenderAfterTag(); } }
// Override the RenderAfterTag method to add the // closing tag of the Font element after the // closing tag of a Label element has been rendered. protected String RenderAfterTag() { // Compare the TagName property value to the // string label to determine whether the element to // be rendered is a Label. If it is a Label, // the closing tag of a Font element is rendered // after the closing tag of the Label element. if (String.Compare(get_TagName(), "label") == 0) { return "</font>"; } // If a Label is not being rendered, use // the base RenderAfterTag method. else { return super.RenderAfterTag(); } } //RenderAfterTag

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHtmlTextWriter.RenderAfterTag メソッドを検索する場合は、下記のリンクをクリックしてください。

- HtmlTextWriter.RenderAfterTag メソッドのページへのリンク