HtmlTextWriter.AddStyleAttribute Method (String, String, HtmlTextWriterStyle)

 
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.

Adds the specified markup style attribute and the attribute value, along with an HtmlTextWriterStyle enumeration value, to the opening markup tag created by a subsequent call to the RenderBeginTag method.

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

protected virtual void AddStyleAttribute(
	string name,
	string value,
	HtmlTextWriterStyle key
)

Parameters

name
Type: System.String

A string that contains the style attribute to be added.

value
Type: System.String

A string that contains the value to assign to the attribute.

key
Type: System.Web.UI.HtmlTextWriterStyle

An HtmlTextWriterStyle that represents the style attribute to add.

Use the AddStyleAttribute overload of the AddStyleAttribute(String, String, HtmlTextWriterStyle) method only when inheriting from the HtmlTextWriter class. It enables you to create new name and value pairs for HtmlTextWriterStyle attributes.

.NET Framework
Available since 1.1
Return to top
Show: