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

Dim returnValue As String returnValue = Me.RenderAfterContent
HTML 要素の内容の後に書き込む空白文字またはテキスト。出力するこのような情報がない場合は null 参照 (Visual Basic では Nothing)。

RenderAfterContent メソッドをオーバーライドする方法を次のコード例に示します。オーバーライドされた各メソッドは、現在レンダリングしているのが th 要素であるかどうかを最初に確認し、次に、SupportsBold メソッドを使用して、要求元のデバイスが太字を表示できるかどうかを確認します。デバイスが太字をサポートしている場合、RenderAfterContent メソッドは b 要素の終了タグを書き込みます。デバイスが太字をサポートしていない場合、RenderAfterContent メソッドは font 要素の終了タグを書き込みます。
次に、現在レンダリングしているのが h4 要素であるかどうかが確認され、SupportsItalic プロパティを使用して、要求元のデバイスが斜体を表示できるかどうかが確認されます。デバイスが斜体をサポートしている場合、RenderAfterContent メソッドは i 要素の終了タグを書き込みます。デバイスが斜体をサポートしていない場合、RenderAfterContent メソッドは font 要素の終了タグを書き込みます。
このコード例は、Html32TextWriter クラスのトピックで取り上げているコード例の一部分です。
' Override the RenderAfterContent method to close ' styles opened during the call to the RenderBeforeContent ' method. Protected Overrides Function RenderAfterContent() As String ' Check whether the element being rendered is a <th> element. ' If so, and the requesting device supports bold formatting, ' render the closing tag of the <b> element. If not, ' render the closing tag of the <font> element. If TagKey = HtmlTextWriterTag.Th Then If SupportsBold Then Return "</b>" Else Return "</font>" End If End If ' Check whether the element being rendered is an <H4>. ' element. If so, and the requesting device supports italic ' formatting, render the closing tag of the <i> element. ' If not, render the closing tag of the <font> element. If TagKey = HtmlTextWriterTag.H4 Then If (SupportsItalic) Then Return "</i>" Else Return "</font>" End If End If ' Call the base method. Return MyBase.RenderAfterContent() End Function
// Override the RenderAfterContent method to close // styles opened during the call to the RenderBeforeContent // method. protected override string RenderAfterContent() { // Check whether the element being rendered is a <th> element. // If so, and the requesting device supports bold formatting, // render the closing tag of the <b> element. If not, // render the closing tag of the <font> element. if (TagKey == HtmlTextWriterTag.Th) { if (SupportsBold) return "</b>"; else return "</font>"; } // Check whether the element being rendered is an <H4>. // element. If so, and the requesting device supports italic // formatting, render the closing tag of the <i> element. // If not, render the closing tag of the <font> element. if (TagKey == HtmlTextWriterTag.H4) { if (SupportsItalic) return "</i>"; else return "</font>"; } // Call the base method return base.RenderAfterContent(); }

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に収録されているすべての辞書からHtml32TextWriter.RenderAfterContent メソッドを検索する場合は、下記のリンクをクリックしてください。

- Html32TextWriter.RenderAfterContent メソッドのページへのリンク