Adding checkbox to your code
Start by opening up Toolbox
by going to View
| Toolbox
(Ctrl+Alt+X). Then type Ch
and drag CheckBox
into the markup, as shown here in the following screenshot:

Figure 3.1.1: CheckBox has been dragged into the markup
CheckBox
is just a box—it either has a check mark or it doesn't. That's it. Then under CheckBox
, wrap the Label
within a panel by typing panel
into the Search Toolbox
field. Drag and drop a panel
control into the page, as shown in the following screenshot:
Adding a panel statement

Figure 3.1.2: A panel line has been inserted into the markup
Close Toolbox
—we don't need it anymore. Now, space it out a little (by hitting the Enter key few times <asp:Label>
) and then drag the Label
into the space between the tags that define the panel
markup. That's it.
In the Design
view, we have just [CheckBox1
] with [sampLabel
] beneath it. Look at it.
Testing the checkbox
Now crank it up in Google Chrome. You will see a simple checkbox. When you click on it, it gets...