System.Web.UI.WebControls.CheckBox Class

Displays a check box that allows the user to select a true or false condition.

See Also: CheckBox Members

Syntax

[System.Web.UI.SupportsEventValidation]
[System.Web.UI.ControlValueProperty("Checked", null)]
[System.ComponentModel.DefaultProperty("Text")]
[System.ComponentModel.DefaultEvent("CheckedChanged")]
[System.Web.UI.DataBindingHandler("System.Web.UI.Design.TextDataBindingHandler, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.Designer("System.Web.UI.Design.WebControls.CheckBoxDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner")]
public class CheckBox : WebControl, System.Web.UI.ICheckBoxControl, System.Web.UI.IPostBackDataHandler

Remarks

In this topic:

Introduction

Use the System.Web.UI.WebControls.CheckBox control to allow the user to select a true or false state.

If you plan to use multiple System.Web.UI.WebControls.CheckBox controls, the System.Web.UI.WebControls.CheckBoxList control is an alternative control that provides convenient data binding capabilities. However, individual System.Web.UI.WebControls.CheckBox controls provide greater control over layout.

Note:

A System.Web.UI.WebControls.CheckBox control accepts user input, which is a potential security threat. By default, ASP.NET mobile Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.

Declarative Syntax

Example

<asp:CheckBox
    AccessKey="string"
    AutoPostBack="True|

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0