System.Web.UI.CssStyleCollection.Add Method

Adds a style item to the System.Web.UI.CssStyleCollection collection of a control using the specified System.Web.UI.HtmlTextWriterStyle enumeration value and corresponding value.

Syntax

public void Add (HtmlTextWriterStyle key, string value)

Parameters

key
The System.Web.UI.HtmlTextWriterStyle enumeration value to add to the collection.
value
The value of the style attribute to add to the collection.

Remarks

If the style item to add exists in the System.Web.UI.HtmlTextWriterStyle enumeration, use this CssStyleCollection.Add(HtmlTextWriterStyle, string) overload of the erload:System.Web.UI.CssStyleCollection.Add method rather than the overload that does not take an System.Web.UI.HtmlTextWriterStyle parameter.

Requirements

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