HtmlTextWriter.WriteStyleAttribute Method

Definition

Writes a style attribute and its value to the output stream.

Overloads

WriteStyleAttribute(String, String, Boolean)

Writes the specified style attribute and value to the output stream, and encodes the value, if specified.

WriteStyleAttribute(String, String)

Writes the specified style attribute to the output stream.

WriteStyleAttribute(String, String, Boolean)

Writes the specified style attribute and value to the output stream, and encodes the value, if specified.

C#
public virtual void WriteStyleAttribute(string name, string value, bool fEncode);

Parameters

name
String

The style attribute to write to the output stream.

value
String

The value assigned to the style attribute.

fEncode
Boolean

true to encode the style attribute and its assigned value; otherwise, false.

Remarks

The WriteStyleAttribute method writes the style attribute in the following form:

name = value ;

The HtmlAttributeEncode method is used to encode the value parameter.

See also

Applies to

.NET Framework 4.8.1 and other versions
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

WriteStyleAttribute(String, String)

Writes the specified style attribute to the output stream.

C#
public virtual void WriteStyleAttribute(string name, string value);

Parameters

name
String

The style attribute to write to the output stream.

value
String

The value assigned to the style attribute.

Remarks

The WriteStyleAttribute method writes the style attribute in the following form:

name = value ;

See also

Applies to

.NET Framework 4.8.1 and other versions
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