HtmlTextWriter.InnerWriter HtmlTextWriter.InnerWriter HtmlTextWriter.InnerWriter HtmlTextWriter.InnerWriter Property

定義

マークアップ要素の内部コンテンツを書き込むテキスト ライターを取得または設定します。Gets or sets the text writer that writes the inner content of the markup element.

public:
 property System::IO::TextWriter ^ InnerWriter { System::IO::TextWriter ^ get(); void set(System::IO::TextWriter ^ value); };
public System.IO.TextWriter InnerWriter { get; set; }
member this.InnerWriter : System.IO.TextWriter with get, set
Public Property InnerWriter As TextWriter

プロパティ値

内部マークアップの内容を書き込む TextWriter オブジェクト。A TextWriter that writes the inner markup content.

次のコード例から派生したカスタム Web サーバー コントロールを使用する方法を示しています、WebControlをオーバーライドするクラス、Renderメソッド。The following code example shows how to use a custom Web server control, derived from the WebControl class, that overrides the Render method. 使用して、HtmlTextWriter書き込むクラスを<font>要素。It uses the HtmlTextWriter class to write a <font> element. 使用して、要素の開始タグを書き込み、後に、InnerWriter文字列に書き込むプロパティ"<br> The time on the server:"の値を持つには、この文字列を連結し、DateTime.Nowプロパティ。After it writes the opening tag of the element, it uses the InnerWriter property to write the string "<br> The time on the server:" and concatenates this string with the value of the DateTime.Now property.

   // Write the opening tag of a Font element.
   writer->WriteBeginTag( "font" );
   
   // Write a Color style attribute to the opening tag
   // of the Font element and set its value to red.
   writer->WriteAttribute( "color", "red" );
   
   // Write the closing character for the opening tag of
   // the Font element.
   writer->Write( '>' );
   
   // Use the InnerWriter property to create a TextWriter
   // object that will write the content found between
   // the opening and closing tags of the Font element.
   // Message is a string property of the control that
   // overrides the Render method.
   TextWriter^ innerTextWriter = writer->InnerWriter;
   innerTextWriter->Write( String::Concat( Message, "<br> The time on the server : ", System::DateTime::Now.ToLongTimeString() ) );
   
   // Write the closing tag of the Font element.
   writer->WriteEndTag( "font" );
}

    // Write the opening tag of a Font element.
    writer.WriteBeginTag("font");
    // Write a Color style attribute to the opening tag
    // of the Font element and set its value to red.
    writer.WriteAttribute("color", "red");
    // Write the closing character for the opening tag of
    // the Font element.
    writer.Write('>');

    // Use the InnerWriter property to create a TextWriter
    // object that will write the content found between
    // the opening and closing tags of the Font element.
    // Message is a string property of the control that 
    // overrides the Render method.
    TextWriter innerTextWriter = writer.InnerWriter;
    innerTextWriter.Write(Message + "<br> The time on the server :" + System.DateTime.Now.ToLongTimeString());

    // Write the closing tag of the Font element.
    writer.WriteEndTag("font");
}
        ' Write the opening tag of a Font element.
        writer.WriteBeginTag("font")
        ' Write a Color style attribute to the opening tag
        ' of the Font element and set its value to red.
        writer.WriteAttribute("color", "red")
        ' Write the closing character for the opening tag of
        ' the Font element.
        writer.Write(">")

        ' Use the InnerWriter property to create a TextWriter
        ' object that will write the content found between
        ' the opening and closing tags of the Font element.
        ' Message is a string property of the control that 
        ' overrides the Render method.
        Dim innerTextWriter As TextWriter = writer.InnerWriter
        innerTextWriter.Write((Message + "<br> The time on the server :" & _
           System.DateTime.Now.ToLongTimeString()))

        ' Write the closing tag of the Font element.
        writer.WriteEndTag("font")
    End Sub 'Render
End Class 'FirstControl 

注釈

内部マークアップの内容は、開始と終了タグのマークアップ言語の要素の間にあるテキストです。Inner markup content is the text found between the opening and closing tags of a markup language element.

場合、InnerWriterプロパティに設定されて、TextWriterオブジェクトのインスタンスでは、HttpWriterクラス、このことが記載されてさらに別の参照を保存します。If the InnerWriter property is set to a TextWriter object that is an instance of the HttpWriter class, this fact is noted and a separate reference is saved.

適用対象

こちらもご覧ください