Gets or sets the number of tab positions to indent the beginning of each line of markup.
Assembly: System.Web (in System.Web.dll)
Indentation is performed by writing the string that is specified by the tabString parameter of the HtmlTextWriter(TextWriter, String) constructor the number of times that are specified by the property.
If the property is set to a negative value, it is changed to 0 before being saved.
The following code example demonstrates how to increment the value that is assigned to the property when attributes have been added to the opening tag of a <span> element and the RenderBeginTag method has been called. This increases the indentation for any markup that is rendered inside the <span> element.
// Set attributes and values along with attributes and styles // attribute defined for a <span> element. writer.AddAttribute(HtmlTextWriterAttribute.Onclick, "alert('Hello');"); writer.AddAttribute("CustomAttribute", "CustomAttributeValue"); writer.AddStyleAttribute(HtmlTextWriterStyle.Color, "Red"); writer.AddStyleAttribute("Customstyle", "CustomStyleValue"); writer.RenderBeginTag(HtmlTextWriterTag.Span); // Create a space and indent the markup inside the // <span> element. writer.WriteLine(); writer.Indent++;
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.