HtmlTextWriter.EqualsChar Field
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 equal sign (=
).
public: char EqualsChar;
public const char EqualsChar;
val mutable EqualsChar : char
Public Const EqualsChar As Char
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);
' 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)
You might want to use the EqualsDoubleQuoteString field instead of the EqualsChar field when constructing the opening delimiter of an attribute value.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: