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

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

HtmlTextWriter.RenderAfterContent メソッド

マークアップ要素内容の後および終了タグ前に出現するテキストまたは空白文字マークアップ出力ストリーム書き込みます

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

Protected Overridable Function
 RenderAfterContent As String
protected virtual string RenderAfterContent
 ()
protected:
virtual String^ RenderAfterContent ()
protected String RenderAfterContent ()
protected function RenderAfterContent () :
 String

戻り値
要素内容の後に書き込む空白文字またはテキスト格納している文字列

解説解説

RenderAfterContent メソッドは、子要素現在のマークアップ要素挿入する場合役立ちます

継承時の注意 HtmlTextWriter クラス実装されている RenderAfterContent メソッドは、null 参照 (Visual Basic では Nothing) を返します要素内容の後、終了タグ前にテキストまたは空白文字書き込む場合は、RenderAfterContentオーバーライドます。

使用例使用例

HtmlTextWriter クラスから派生したクラスRenderAfterContent メソッドオーバーライドして、<label> 要素出力するかどうか確認する方法次のコード例示します出力する場合は、RenderAfterContent オーバーライド<label> 要素終了タグ直前に、<font> 要素終了タグ挿入します<label> 以外の要素出力する場合は、RenderAfterContent 基本メソッド使用されます。

' Override the RenderAfterContent method to render
' the closing tag of a font element if the 
' rendered tag is a label element.
Protected Overrides Function
 RenderAfterContent() As String
    ' Check to determine whether the element being rendered
    ' is a label element. If so, render the closing tag
    ' of the font element; otherwise, call the base method.
    If TagKey = HtmlTextWriterTag.Label Then
        Return "</font>"
    Else
        Return MyBase.RenderAfterContent()
    End If
End Function 'RenderAfterContent
// Override the RenderAfterContent method to render
// the closing tag of a font element if the 
// rendered tag is a label element.
protected override string RenderAfterContent()
{
    // Check to determine whether the element being rendered
    // is a label element. If so, render the closing tag
    // of the font element; otherwise, call the base method.
    if (TagKey == HtmlTextWriterTag.Label)
    {
        return "</font>";
    }
    else
    {
        return base.RenderAfterContent();
    }
}
// Override the RenderAfterContent method to render
// the closing tag of a font element if the
// rendered tag is a label element.

virtual String^ RenderAfterContent() override
{
   
   // Check to determine whether the element being rendered
   // is a label element. If so, render the closing tag
   // of the font element; otherwise, call the base method.
   if ( TagKey == HtmlTextWriterTag::Label )
   {
      return "</font>";
   }
   else
   {
      return __super::RenderAfterContent();
   }
}

// Override the RenderAfterContent method to render
// the closing tag of a font element if the 
// rendered tag is a label element.
protected String RenderAfterContent()
{
    // Check to determine whether the element being rendered
    // is a label element. If so, render the closing tag
    // of the font element; otherwise, call the base method.
    if (get_TagKey().Equals(HtmlTextWriterTag.Label)) {
        return "</font>";
    }
    else {
        return super.RenderAfterContent();
    }
} //RenderAfterContent
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HtmlTextWriter クラス
HtmlTextWriter メンバ
System.Web.UI 名前空間
TextWriter


このページでは「.NET Framework クラス ライブラリ リファレンス」からHtmlTextWriter.RenderAfterContent メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHtmlTextWriter.RenderAfterContent メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHtmlTextWriter.RenderAfterContent メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

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

   

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



HtmlTextWriter.RenderAfterContent メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS