ASP.NET CheckBox Control
Tutorial -- Learning is not just about technology, but also about dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
ASP.NET Tutorial
ASP.NET Tutorial ASP.NET Introduction
WP Tutorial
WebPages Introduction WebPages Razor WebPages Layout WebPages Folders WebPages Global WebPages Forms WebPages Objects WebPages Files WebPages Helpers WebPages WebGrid WebPages Charts WebPages Email WebPages PHP WebPages Publish WebPages Examples
WP Reference Manual
WebPages Classes WebPages Security WebPages Database WebPages WebMail WebPages Helpers
ASP.NET Razor
Razor Introduction Razor Syntax Razor C# Variables Razor C# Loops Razor C# Logic Razor VB Variables Razor VB Loops Razor VB Logic
ASP.NET MVC
MVC Introduction MVC Application MVC Folders MVC Layout MVC Controllers MVC Views MVC Database MVC Models MVC Security MVC HTML Helpers MVC Publish MVC Reference
WF Tutorial
WebForms Introduction WebForms Pages WebForms Controls WebForms Events WebForms Forms WebForms ViewState WebForms TextBox WebForms Button WebForms Data Binding WebForms ArrayList WebForms Hashtable WebForms SortedList WebForms XML Files WebForms Repeater WebForms DataList WebForms Database Connection WebForms Master Pages WebForms Navigation WebForms Examples
WF Reference Manual
WebForms HTML WebForms Controls WebForms Validation
ASP.NET Validation Server Controls
ASP.NET CheckBox Control
Definition and Usage
The CheckBox control is used to display a checkbox.
Properties
| Property | Description | .NET |
|---|---|---|
| AutoPostBack | Specifies whether the form is posted back to the server immediately when the Checked property is changed. Default is false. | 1.0 |
| CausesValidation | Specifies whether validation is performed when the Button control is clicked. | 2.0 |
| Checked | Specifies whether the checkbox is checked. | 1.0 |
| InputAttributes | A collection of attribute names and values used for the Input element of the CheckBox control. | 2.0 |
| LabelAttributes | A collection of attribute names and values used for the Label element of the CheckBox control. | 2.0 |
| runat | Specifies that the control is a server control. Must be set to "server". | 1.0 |
| Text | The text label associated with the checkbox. | 1.0 |
| TextAlign | The alignment of the text label associated with the checkbox. (right or left) | 1.0 |
| ValidationGroup | The group of controls to validate when the CheckBox control posts back to the server. | 2.0 |
| OnCheckedChanged | The name of the function to execute when the Checked property is changed. |
Web Control Standard Properties
AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width
For a complete description, please visit Web Control Standard Properties.
Control Standard Properties
AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible
For a complete description, please visit Control Standard Properties.
Example
In this example, we declared two TextBox controls and one CheckBox control in an .aspx file. Then, we created an event handler for the CheckedChanged event to copy the content of the text box containing the home phone to the text box containing the work phone.
YouTip