CssStyleCollection Class
.NET Framework 3.0
Contains the HTML cascading-style sheets (CSS) inline style attributes for a specified HTML server control. This class cannot be inherited.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
Any style declared for a particular HTML server control is added to the collection when the containing Web Forms page is parsed. It automatically parses and exposes CSS properties through a dictionary pattern API. You can manipulate any CSS property on a server control through the Style property. Simply use the CSS property's key and value in the indexed collection.
The following code example iterates through the CssStyleCollection object for an HtmlInputText server control. The Keys property is used to determine which style attributes have been declared on the server control, and then binds the attribute names and values to a DataList object on the Web Forms page.
- AspNetHostingPermission for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
Community Additions
ADD
Show: