System.Web.UI.WebControls Namespace
Renders a check box control.
Visibility |
Constructor |
Parameters |
public |
CheckBox |
( )
|
|
Use the CheckBox class to create a control that allows the user to select either a true or false state.
To determine whether the control is selected, use the Checked property.
The CheckBox control provides a CheckedChanged event that is raised when the Checked property changes value between posts to the server. This allows you to define an event handler to perform a custom set of instructions each time the event is raised.
The CheckBox control does not automatically post back to the server when clicked. You must either provide another control on the Web page that supports posting to the server, such as a Button control, or set the AutoPostback property to true to automatically send the state of the control back to the server.
If you need to use multiple CheckBox controls, the CheckBoxList is an alternative control that provides convenient data binding capabilities. Individual CheckBox controls, though, provide greater control over layout.
For examples illustrating use of this control, see the individual member types of this class. For syntax information, see CheckBox in ASP.NET Syntax for Web Controls.
CheckBoxList RadioButton RadioButtonList