Html32TextWriter.RenderAfterContent メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Html32TextWriter.RenderAfterContent メソッドの意味・解説 

Html32TextWriter.RenderAfterContent メソッド

HTML 要素の内容の後にテキストまたは空白文字を書き込みます。

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

使用例使用例

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();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Html32TextWriter クラス
Html32TextWriter メンバ
System.Web.UI 名前空間
RenderBeforeContent



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

Html32TextWriter.RenderAfterContent メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Html32TextWriter.RenderAfterContent メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS