Adding Controls
Before proceeding, delete the line that tells the time from your aspx page, so that you can start the next part clean. In fact, that is the last time you'll mix HTML and code; from now on you'll add controls to the aspx page, and code in the code-behind (aspx.vb) page.
You can add server-side controls to a web form in three ways: by dragging controls from the Toolbox to the Design page, by writing HTML into the source page, or by programmatically adding them at runtime. For example, suppose you want to use buttons to let the user choose one of three shippers provided in the Northwind database. To do so, click on Design view, and drag a RadioButtonList control onto the form, as shown in Figure 8-10.

Figure 8-10. Drag a RadioButtonList onto the form
Once the RadioButtonList control is on your form, click its smart tag and choose Edit Items to add items to the list, as shown in Figure 8-11.

Figure 8-11. Edit items in RadioButtonList
The ListItem Collection Editor opens. Click the Add button to add a List Item. Type in Text (e.g., "Speedy Express") and for the first item set Selected to True (to select the first radio button in the list). Add entries for "United Package" and for "Federal Shipping," as shown in Figure 8-12.
When you click OK, the three buttons appear in the group. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access