CheckBox ASP.NET Server Control

There are two types of CheckBox server controls: CheckBox and CheckBoxList. The Checkbox control provides a way for users to input Boolean data, either a true or false value. For example, you could provide a CheckBox on your site so users could indicate whether they would like to receive a weekly newsletter. If they would not like to receive it, they wouldn't check the box.

One attribute with which you should be familiar when using the CheckBox control is the Checked attribute. The Checked attribute expects a Boolean value (true or false) and if true the CheckBox will be selected; if false then it is not. Listing 8.16 demonstrates the use of the CheckBox control—the top CheckBox has Checked set to true and the ...

Get Programming Data-Driven Web Applications with ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.