ASP.NET CheckBoxControl


Web Server ControlsWeb Server Controls

Definition and Usage

The CheckBox control is used to display a check box.


Properties

Property Description .NET
AutoPostBack Specifies whether to post back to the server immediately after the Checked property has been changed. Default is false. 1.0
CausesValidation Specifies whether validation is performed when a Button control is clicked. 2.0
Checked Specifies whether the check box is checked. 1.0
InputAttributes A collection of attribute names and values used by the Input element of the CheckBox control. 2.0
LabelAttributes A collection of attribute names and values used by the Label element of the CheckBox control. 2.0
runat Specifies that the control is a server control. Must be set to "server". 1.0
Text A text label associated with the check box. 1.0
TextAlign The alignment of the text label associated with the check box. (right or left) 1.0
ValidationGroup The control group to be validated when the CheckBox control posts back to the server. 2.0
OnCheckedChanged The name of the function to execute when the Checked property is changed.

Web Control Standard Properties

AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width

For a full description, please visitWeb Control Standard Properties。

Control Standard Properties

AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible

For a full description, please visitControl Standard Properties。


Examples

Checkbox
In this example, we declare two TextBox controls and one CheckBox control in a .aspx file. Then, we create an event handler for the CheckedChanged event that copies the content of the text box containing home phone to the text box containing work phone.


Web Server ControlsWeb Server Controls Other Extensions