System.Web.UI.HtmlTextWriter.AddStyleAttribute Method

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

Syntax

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

Parameters

name
A string that contains the style attribute to be added.
value
A string that contains the value to assign to the attribute.
key
An System.Web.UI.HtmlTextWriterStyle that represents the style attribute to add.

Remarks

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

Requirements

Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0