Datasheet
This creates HTML with a Wizard that contains multiple steps. Listing 1-1 shows the HTML of this page
with modifications made in the later parts of this section. The HTML you see in Listing 1-1 was automat-
ically generated by Visual Studio 2005 as you performed steps 1 through 20. Select the HTML tab at the
bottom of the Visual Studio 2005 editor to switch from Design view to HTML view. When you do this,
you will see code similar to Listing 1-1.
Listing 1-1: The ASP.NET v2.0 Wizard control with multiple steps
<%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs”
Inherits=”_Default” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” >
<head runat=”server”>
<title>Wizard Demo</title>
</head>
<body>
<form id=”form1” runat=”server”>
<div>
<asp:Wizard ID=”Wizard1” runat=”server”
ActiveStepIndex=”0” HeaderText=”Menu Selector”
Height=”200px” Width=”400px”
OnFinishButtonClick=”Wizard1_FinishButtonClick”
OnNextButtonClick=”Wizard1_NextButtonClick”>
<WizardSteps>
<asp:WizardStep runat=”server” Title=”Step 1”>
What is your eating preference?<br />
<br />
<asp:RadioButtonList ID=”RadioButtonList1” runat=”server”>
<asp:ListItem>Meat Eater</asp:ListItem>
<asp:ListItem>Vegetarian</asp:ListItem>
</asp:RadioButtonList>
</asp:WizardStep>
<asp:WizardStep runat=”server” Title=”Step 2”>
Please select main course:<br />
<br />
<asp:RadioButtonList ID=”RadioButtonList2” runat=”server”>
<asp:ListItem>Chicken</asp:ListItem>
<asp:ListItem>Fish</asp:ListItem>
<asp:ListItem>Steak</asp:ListItem>
</asp:RadioButtonList>
</asp:WizardStep>
<asp:WizardStep runat=”server” Title=”Step 3”>
Please select main course:<br />
<br />
<asp:RadioButtonList ID=”RadioButtonList3” runat=”server”>
<asp:ListItem>Bread</asp:ListItem>
<asp:ListItem>Salad</asp:ListItem>
<asp:ListItem>Veggie Tray</asp:ListItem>
</asp:RadioButtonList>
</asp:WizardStep>
<asp:WizardStep runat=”server” Title=”Step 4”>
(continued)
7
Hacks Revisited
04_597663 ch01.qxp 4/25/06 9:54 PM Page 7