System.Web.UI.WebControls.WebControl.Style Property

Gets a collection of text attributes that will be rendered as a style attribute on the outer tag of the Web server control.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public System.Web.UI.CssStyleCollection Style { get; }

Value

a System.Web.UI.CssStyleCollection

Remarks

Use the WebControl.Style collection to manage the style attributes rendered in the outer tag of the Web server control. This property will render on all browsers for all controls.

Note:

Browsers that do not support style attributes will ignore the rendered HTML.

Any style values set through the strongly typed style properties (for example, BackColor="Red") will automatically override a corresponding value in this collection.

Values set in this collection are not automatically reflected by the strongly typed style properties.

Requirements

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