Wizard
Wizard
This code shows sample use of Wizard.Design view:
<form id="form1" runat="server">
<div>
<asp:Wizard ID="Wizard1" DisplaySideBar="true" Runat="server" Height="231px" Width="445px" ActiveStepIndex="0" OnFinishButtonClick="Wizard1_FinishButtonClick">
<WizardSteps>
<asp:WizardStep ID="WizardStepPersonal" Runat="server" Title="Personal" StepType="Start">
<table>
<tr>
<td>
Enter Name:<asp:TextBox ID="txtPersonal" runat="server"> </asp:TextBox>
<asp:RequiredFieldValidator ID="ReqValidatePersonal" runat="server" ErrorMessage="!"
ControlToValidate="txtPersonal"></asp:RequiredFieldValidator><br />
Email:<asp:TextBox ID="txtEmail" runat="server"> </asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldEmail" runat="server" ErrorMessage="!"
ControlToValidate="txtEmail"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</asp:WizardStep>
<asp:WizardStep ID="WizardStepOffice" Runat="server" Title="Office">
<table>
<tr>
<td>
Company Name:<asp:TextBox ID="txtOffice" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="ReqValidateOffice" runat="server" ErrorMessage="!"
ControlToValidate="txtOffice"></asp:RequiredFieldValidator>
City:<asp:TextBox ID="txtCity" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="ReqValidateCity" runat="server" ErrorMessage="!"
ControlToValidate="txtCity"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Contact" StepType="Finish">
<table>
<tr>
<td>
Residence:<asp:TextBox ID="txtContact" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="ReqValidateContact" runat="server" ErrorMessage="!"
ControlToValidate="txtContact"></asp:RequiredFieldValidator>
Office:<asp:TextBox ID="txtOfficeExtn" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="ReqValidateExtn" runat="server" ErrorMessage="!"
ControlToValidate="txtOfficeExtn"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
<asp:Label ID="lblPersonal" runat="server"></asp:Label><br />
<asp:Label ID="lblContact" runat="server"></asp:Label><br />
<asp:Label ID="lblOffice" runat="server"></asp:Label>
</form>
</div>Code Behind
protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
{
string sPersonal = ((TextBox)Wizard1.WizardSteps[0].FindControl("txtPersonal")).Text;
string sEmail = ((TextBox)Wizard1.WizardSteps[0].FindControl("txtEmail")).Text;
string sCompnay = ((TextBox)Wizard1.WizardSteps[0].FindControl("txtOffice")).Text;
string sCity = ((TextBox)Wizard1.WizardSteps[0].FindControl("txtCity")).Text;
string sResidence = ((TextBox)Wizard1.WizardSteps[0].FindControl("txtContact")).Text;
string sExtn = ((TextBox)Wizard1.WizardSteps[0].FindControl("txtOfficeExtn")).Text;
lblPersonal.Text = "Name : " + sPersonal + "
" + "Email :" + sEmail;
lblOffice.Text = " Company Name : " + sCompnay + "
" + "City :" + sCity;
lblContact.Text = " Residence Phone : " + sResidence + "
" + "Office Extension :" + sExtn;
}
Thanks to posting useful code snippet . But Dear Satya It is not running successfully in programm