HtmlTextWriter.StyleEqualsChar Field
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the style equals (:
) character used to set style attributes equal to values.
public: char StyleEqualsChar;
public const char StyleEqualsChar;
val mutable StyleEqualsChar : char
Public Const StyleEqualsChar As Char
Field Value
Examples
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);
' 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)
Remarks
The StyleEqualsChar field is used by the WriteStyleAttribute method to delimit style names and values.