HtmlTextWriter.EqualsChar Field

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Represents the equal sign (=).

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

public const char EqualsChar

Field Value

Type: System.Char

You might want to use the EqualsDoubleQuoteString field instead of the EqualsChar field when constructing the opening delimiter of an attribute value.

The following code example shows how to render the src attribute and part of its value for an <img> element. The code uses the EqualsChar field in a Write method call to render the equal sign (=) between the src attribute and its value.

This code example renders the following markup:

src="/images/

// Write the src attribute and the path
// for the image file.
writer.Write("src");
writer.Write(HtmlTextWriter.EqualsChar);
writer.Write(HtmlTextWriter.DoubleQuoteChar);
writer.Write(HtmlTextWriter.SlashChar);
writer.Write("images");
writer.Write(HtmlTextWriter.SlashChar);

.NET Framework
Available since 1.1
Return to top
Show: