HtmlTextWriter コンストラクタとは? わかりやすく解説

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

HtmlTextWriter コンストラクタ (TextWriter)

既定タブ文字列を使用する HtmlTextWriter クラス新しインスタンス初期化します。

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

解説解説
使用例使用例

HtmlTextWriter(TextWriter) コンストラクタ使用してStyledLabelHtmlWriter という名前のカスタム HtmlTextWriter オブジェクト作成する方法次のコード例示しますPage クラスから派生した MyPage カスタム クラスクライアント ブラウザによって要求されると、StyledLabelHtmlWriter クラス使用して出力ストリーム内容出力されます。

' A custom class that overrides the CreateHtmlTextWriter method.
' This page uses the StyledLabelHtmlWriter to render its content.  
<AspNetHostingPermission(SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Class MyPage
    Inherits Page

    Protected Overrides Function
 CreateHtmlTextWriter(ByVal writer As TextWriter)
 As HtmlTextWriter
        Return New HtmlStyledLabelWriter(writer)
    End Function 'CreateHtmlTextWriter
End Class 'MyPage
// A custom class that overrides its CreateHtmlTextWriter method.
// This page uses the HtmlStyledLabelWriter class to render its content.
[AspNetHostingPermission(SecurityAction.Demand,
    Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand,
    Level = AspNetHostingPermissionLevel.Minimal)]
public class MyPage : Page
{
    protected override HtmlTextWriter CreateHtmlTextWriter(TextWriter
 writer)
    {
        return new HtmlStyledLabelWriter(writer);
    }

}
// A custom class that overrides its CreateHtmlTextWriter method.
// This page uses the StyledLabelHtmlWriter class to render its content.
public ref class MyPage: public
 Page
{
protected:
   virtual HtmlTextWriter^ CreateHtmlTextWriter( TextWriter^ writer ) override
   {
      return gcnew HtmlStyledLabelWriter( writer );
   }
};
// A custom class that overrides its CreateHtmlTextWriter method.
// This page uses the HtmlStyledLabelWriter class to render its content.
public class MyPage extends Page
{
    protected HtmlTextWriter CreateHtmlTextWriter(TextWriter writer)
    {
        return new HtmlStyledLabelWriter(writer);
    } //CreateHtmlTextWriter
} //MyPage
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HtmlTextWriter クラス
HtmlTextWriter メンバ
System.Web.UI 名前空間
TextWriter
DefaultTabString

HtmlTextWriter コンストラクタ

HtmlTextWriter クラス新しインスタンス初期化します。
オーバーロードの一覧オーバーロードの一覧

参照参照

関連項目

HtmlTextWriter クラス
HtmlTextWriter メンバ
System.Web.UI 名前空間
TextWriter
DefaultTabString

HtmlTextWriter コンストラクタ (TextWriter, String)

タブ文字列を指定して、HtmlTextWriter クラス新しインスタンス初期化します。

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

Public Sub New ( _
    writer As TextWriter, _
    tabString As String _
)
Dim writer As TextWriter
Dim tabString As String

Dim instance As New HtmlTextWriter(writer,
 tabString)
public HtmlTextWriter (
    TextWriter writer,
    string tabString
)
public:
HtmlTextWriter (
    TextWriter^ writer, 
    String^ tabString
)
public HtmlTextWriter (
    TextWriter writer, 
    String tabString
)
public function HtmlTextWriter (
    writer : TextWriter, 
    tabString : String
)

パラメータ

writer

マークアップ コンテンツ出力する TextWriter

tabString

行のインデント出力するために使用する文字列

解説解説

HtmlTextWriter(TextWriter,String) コンストラクタHtmlTextWriter オーバーロードは、行のインデント必要な場合tabString使用します。これにより、System.IO.TextWriter 基本コンストラクタ呼び出され新しインスタンス初期化されます

使用例使用例

HtmlTextWriter(TextWriter) コンストラクタ使用してStyledLabelHtmlWriter という名前のカスタム HtmlTextWriter オブジェクト作成する方法次のコード例示しますPage クラスから派生した MyPage カスタム クラスクライアント ブラウザによって要求されると、StyledLabelHtmlWriter クラス使用して出力ストリーム内容出力されます。

' A custom class that overrides the CreateHtmlTextWriter method.
' This page uses the StyledLabelHtmlWriter to render its content.  
<AspNetHostingPermission(SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Class MyPage
    Inherits Page

    Protected Overrides Function
 CreateHtmlTextWriter(ByVal writer As TextWriter)
 As HtmlTextWriter
        Return New HtmlStyledLabelWriter(writer)
    End Function 'CreateHtmlTextWriter
End Class 'MyPage
// A custom class that overrides its CreateHtmlTextWriter method.
// This page uses the HtmlStyledLabelWriter class to render its content.
[AspNetHostingPermission(SecurityAction.Demand,
    Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand,
    Level = AspNetHostingPermissionLevel.Minimal)]
public class MyPage : Page
{
    protected override HtmlTextWriter CreateHtmlTextWriter(TextWriter
 writer)
    {
        return new HtmlStyledLabelWriter(writer);
    }

}
// A custom class that overrides its CreateHtmlTextWriter method.
// This page uses the StyledLabelHtmlWriter class to render its content.
public ref class MyPage: public
 Page
{
protected:
   virtual HtmlTextWriter^ CreateHtmlTextWriter( TextWriter^ writer ) override
   {
      return gcnew HtmlStyledLabelWriter( writer );
   }
};
// A custom class that overrides its CreateHtmlTextWriter method.
// This page uses the HtmlStyledLabelWriter class to render its content.
public class MyPage extends Page
{
    protected HtmlTextWriter CreateHtmlTextWriter(TextWriter writer)
    {
        return new HtmlStyledLabelWriter(writer);
    } //CreateHtmlTextWriter
} //MyPage
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HtmlTextWriter クラス
HtmlTextWriter メンバ
System.Web.UI 名前空間
TextWriter



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

辞書ショートカット

すべての辞書の索引

「HtmlTextWriter コンストラクタ」の関連用語

HtmlTextWriter コンストラクタのお隣キーワード
検索ランキング

   

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



HtmlTextWriter コンストラクタのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS