|
Web Controls
A control is an object that can be drawn on to the Web Form to enable or enhance user
interaction with the application. Examples of these controls include the TextBoxes,
Buttons, Labels, Radio Buttons etc. All these Web server controls are based on
the System.Web.UI.Control class and the class hierarchy
is as follows:
Object
Control
Notable properties of the Control objects are summarized in the table below:
| Property | Description |
| ClientID | Gets the ASP.NET control identifier for the control |
| Controls | Gets a collection of child controls in a control |
| EnableViewState | Gets/Sets whether the control maintains it's state between server round trips |
| ID | Gets/Sets the ID for the control |
| Page | Gets the page object that contains the control |
| Parent | Gets the control parent control |
| Site | Gets the control's Web site |
| UniqueID | Gets the Unique ID for the control |
| Visible | Gets/Sets whether the control is visible or not |
The WebControl Class
Web server controls in ASP.NET are not based directly on the Control class but are
based on the WebControl class, which is based on the Control class. The class hierarchy
for the WebControl class is as follows:
Object
Control
WebControl
Notable properties of the WebControl class are summarized in the table below:
| Property | Description |
| AccessKey | Gets/Sets the access key for the control |
| Attributes | Gets a collection of attributes used to render the control |
| BackColor | Gets/Sets the control's background color |
| BorderColor | Gets/Sets the controls border color |
| BorderStyle | Gets/Sets the control's border style |
| BorderWidth | Gets/Sets the control's border width |
| ControlStyle | Gets the control's style |
| CssClass | Gets/Sets the control's CSS class |
| Enabled | Gets/Sets whether the control is enabled |
| Font | Gets/Sets the font for the control |
| ForeColor | Gets/Sets the control's foreground color |
| Height | Gets/Sets the control's height |
| Style | Gets the HTML style of the control as a collection of text attributes |
| TabIndex | Gets/Sets the control's tab index |
| ToolTip | Gets/Sets the control's tool tip text |
| Width | Gets/Sets the control's width |
|