ASP.NET CheckBox Control.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
The ASP:NET CheckBox control is used to allow the user to check items that apply to the users selection. The CheckBox is either Checked (true) or UnChecked (false). The ASP.NET CheckBox control is rendered as
HTML input type checkbox. If text is associated with the CheckBox control, the control is rendered as the HTML input element type checkbox and the
HTML label element for the text field.
Example.
Example creating the CheckBox control.
< asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged"
Text="Select or not." BackColor="White" AutoPostBack="True" />
The above example will be rendered as HTML with the result below (source).
<span style="background-color:White;"><input id="ctl00_ContentPlaceHolder1_CheckBox1" type="checkbox" name="ctl00$ContentPlaceHolder1$CheckBox1" onclick="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$CheckBox1\',\'\')', 0)" /><label for="ctl00_ContentPlaceHolder1_CheckBox1">Select or not.</label></span>
|