The CheckBox control can act as a two- or tristate checkbox or radiobutton.
Use the CheckBox.Checked or CheckBox.State properties to get or set the control's state.
The CheckBox control can represent either a checkbox or a radiobutton control depending on the value of the DisplayType property. Use the TriState property to specify whether the control supports indeterminate state. Use the GroupName property to specify mutually exclusive controls.
Adjust the interaction with the control by setting the SubmitOnEnter and AutoPostBack properties according to your needs.
By setting the Label and LabelPosition properties you can specify a caption for the control.
The following events are exposed by the CheckBox class.
Event | Event arguments | Description |
---|---|---|
Raised when the state of the control changes. |
You can access the control on the client side by its ClientID.
JavaScript
![]() |
---|
var checkBox = $find("CheckBox1"); var checkBox = $find("<%= CheckBox1.ClientID %>"); |
Use the get_state and set_state or get_checked and set_checked methods to get or set the control's state.
JavaScript
![]() |
---|
checkBox.set_checked(true); |
The following client-side events are exposed by the CheckBox class.
Event | Event arguments | Script property | Description |
---|---|---|---|
Raised when a control's state is about to be changed. | |||
Raised when a control's state has changed. | |||
- | Raised just after the control has finished loading and is ready for interaction. |