Base Web Server Control Properties
The properties listed in the following table apply to all Web server controls that derive from the WebControl class. Web server controls that do not inherit from the WebControl class include Literal, PlaceHolder, Repeater, and Xml.
Properties
The control's keyboard shortcut key (AccessKey). This property specifies a single letter or number that the user can press while pressing ALT. For example, specify "K" if you want the user to press ALT+K to access the control. Shortcut keys are supported only in Microsoft Internet Explorer 4.0 and later versions. |
|
The collection of additional attributes on the control not defined by a public property, but that should also be rendered. Any attribute that is not defined by the Web server control is added to this collection. This allows you to use an HTML attribute that is not directly supported by the control. Note This property is used only when programming; it cannot be set when declaring the control. |
|
The background color of the control. The BackColor property can be set using standard HTML color identifiers: the name of a color ("black" or "red") or an RGB value expressed in hexadecimal format ("#ffffff"). |
|
The border color of the control. The BorderColor property can be set using standard HTML color identifiers: the name of a color ("black" or "red") or an RGB value expressed in hexadecimal format ("#ffffff"). |
|
The width of the control's border (if any) in pixels. Note This property might not work for all controls in browsers earlier than Internet Explorer 4.0. |
|
The control's border style, if any. The possible values are:
|
|
The cascading style sheets (CSS) class to assign to the control. |
|
A collection of text attributes that are rendered as a CSS style attribute on the outer tag of the control. Note Any style values set using style properties (for example, BackColor) will automatically override a corresponding value in this collection. Values set using this property are not automatically reflected in the strongly typed style properties. Some controls support style objects that allow you to apply style properties to individual elements of the control. Those properties override any settings you make using the Style property. |
|
Makes the control functional when this property is set to true (the default). Disables the control when this property is set to false. Note Disabling a control dims the control and makes it inactive. It does not hide the control. |
|
Enables view state persistence for the control when this property is set to true (the default). Disables view state persistence for this control when this property is set to false. |
|
Enables themes for the control when this property is set to true (the default). Disables themes for this control when this property is set to false. |
|
Provides font information for the Web server control that you are declaring. This property includes subproperties that you can declare using the property-subproperty syntax in the opening tag of a Web server control element. For example, you can make a Web server control's text bold by including the Font-Bold attribute in its opening tag. |
|
The foreground color of the control. Note This property might not work for all controls in browsers earlier than Internet Explorer 4.0. |
|
The control's height. Note This property might not work for all controls in browsers earlier than Internet Explorer 4.0. |
|
The skin to apply to the control. |
|
The control's position in the tab order. If this property is not set, the control's position index is 0. Controls with the same tab index can be tabbed to according to the order in which they are declared in the Web page. Note This property only works in Internet Explorer 4.0 and later. |
|
The text that appears when the user positions the mouse pointer over a control. Note The ToolTip property does not work in all browsers. Check with the browser for compatibility. |
|
The fixed width of the control. The possible units are:
For example, to declaratively set a width of 100 expressed in points would be 100pt. For information about setting width programmatically, see How to: Set Web Server Control Unit Properties. Note The default unit is pixels. Not all browsers support every unit type. |