Export (0) Print
Expand All

HtmlTextWriter.StyleEqualsChar Field

Represents the style equals (:) character used to set style attributes equal to values.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public const char StyleEqualsChar

The StyleEqualsChar field is used by the WriteStyleAttribute method to delimit style names and values.

The following code example demonstrates how to render a FontWeight attribute and value of bold to the opening tag of an element. The code example uses the Write method with the StyleEqualsChar field as the parameter to render the character that sets the value of each style attribute.

This code example renders the following markup:

FontWeight:"bold"

// Write a space and a FontWeight 
// attribute to the tag.
writer.Write(HtmlTextWriter.SpaceChar);
writer.Write("FontWeight");

// Set the FontWeight attribute to Bold.
writer.Write(HtmlTextWriter.StyleEqualsChar);
writer.Write(HtmlTextWriter.DoubleQuoteChar);
writer.Write("bold");
writer.Write(HtmlTextWriter.DoubleQuoteChar);

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1
Show:
© 2015 Microsoft