XhtmlTextWriter.XhtmlTextWriter(TextWriter) Constructor
.NET Framework 3.0
Initializes a new instance of the XhtmlTextWriter class that uses the line indentation that is specified in the DefaultTabString field. Use the XhtmlTextWriter constructor if you do not want to change the default line indentation.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
The following code example demonstrates how to create the two constructors, which is standard for all classes that derive directly or indirectly from the HtmlTextWriter class, for a custom class that is derived from the XhtmlTextWriter class.
// Create a class that inherits from XhtmlTextWriter.
/** @attribute AspNetHostingPermission(SecurityAction.Demand,
Level = AspNetHostingPermissionLevel.Minimal)
*/
/** @attribute AspNetHostingPermission(SecurityAction.InheritanceDemand,
Level = AspNetHostingPermissionLevel.Minimal)
*/
public class CustomXhtmlTextWriter extends XhtmlTextWriter
{
// Create two constructors, following
// the pattern for implementing a
// TextWriter constructor.
public CustomXhtmlTextWriter(TextWriter writer)
{
this(writer, DefaultTabString);
} //CustomXhtmlTextWriter
public CustomXhtmlTextWriter(TextWriter writer, String tabString)
{
super(writer, tabString);
} //CustomXhtmlTextWriter
Community Additions
ADD
Show: