System.Web.UI.CssStyleCollection.Add Method

Adds a style item to the System.Web.UI.CssStyleCollection of a control using the specified name/value pair.

Syntax

public void Add (string key, string value)

Parameters

key
The name of the new style attribute 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 the overload of the erload:System.Web.UI.CssStyleCollection.Add method that takes an System.Web.UI.HtmlTextWriterStyle parameter because it is strongly typed. This means that items that are added will be included when viewing items with the get accessor of the CssStyleCollection.Item(HtmlTextWriterStyle) property.

Requirements

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