Gets or sets the text writer that writes the inner content of the markup element.
Assembly: System.Web (in System.Web.dll)
The following code example shows how to use a custom Web server control, derived from the WebControl class, that overrides the Render method. It uses the HtmlTextWriter class to write a <font> element. After it writes the opening tag of the element, it uses the 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(Message + "<br> The time on the server :" + System.DateTime.Now.ToLongTimeString()); // Write the closing tag of the Font element. writer.WriteEndTag("font"); }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.