Latest web development tutorials

ASP.NET CheckBox controls

Web Server Controls Web server control

Definition and Usage

CheckBox control to display box.


Attributes

属性 描述 .NET
AutoPostBack 规定在 Checked 属性已改变后,是否立即向服务器回传表单。默认是 false。 1.0
CausesValidation 规定点击 Button 控件时是否执行验证。 2.0
Checked 规定是否已选中该复选框。 1.0
InputAttributes 该 CheckBox 控件的 Input 元素所用的属性名和值的集合。 2.0
LabelAttributes 该 CheckBox 控件的 Label 元素所用的属性名和值的集合。 2.0
runat 规定该控件是服务器控件。必须被设置为 "server"。 1.0
Text 与复选框关联的文本标签。 1.0
TextAlign 与复选框关联的文本标签的对齐方式。(right 或 left) 1.0
ValidationGroup 在 CheckBox 控件回发到服务器时要进行验证的控件组。 2.0
OnCheckedChanged 当 Checked 属性被改变时,被执行函数的名称。

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, visit the Web Control Standard Attributes .

Control Standard Properties

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

For a full description, go to Control Standard Attributes .


Examples

Checkbox
In this example, we declare two TextBox controls and a CheckBox control in an .aspx file. We then create an event handler for the event CheckedChanged, copy the contents of the text box contains the home phone work phone to contain the text box.


Web Server Controls Web server control