Datasheet

Listing 1-1 (continued)
Please select beverage:<br />
<br />
<asp:RadioButtonList ID=”RadioButtonList4” runat=”server”>
<asp:ListItem>Coffee</asp:ListItem>
<asp:ListItem>Water</asp:ListItem>
<asp:ListItem>Wine</asp:ListItem>
</asp:RadioButtonList>
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
</div>
</form>
</body>
</html>
As you can see from the steps of Listing 1-1 and Figure 1-8, the user is either a Meat Eater or a
Vegetarian. They should see only the menu items corresponding to their selection.
Figure 1-8
To specify different menus, the Wizard control will have to navigate to a different step, depending on
what was selected in Step 1. ASP.NET Wizard controls support events, and that is what we’ll use to
ensure that the proper step appears, depending on eating preference. Listing 1-2 shows how to navigate
properly when the user clicks the Next button. Click the lightning bolt icon on the Properties window
and double-click the NextButtonClick event to produce an event handler shell, which will have a default
name of Wizard1_NextButtonClick. Type in the algorithm for the Wizard1_NextButtonClick event han-
dler as shown in Listing 1-2.
8
Chapter 1
04_597663 ch01.qxp 4/25/06 9:54 PM Page 8