Listing 6-19
Hi again! in a case you also have not understood this one,here is the
fix.In the beginning I could not solve this problem :)
Listing 6-19 Applying logical checks on whether to show a step
As shown in the Book: use the NextButtonClick event from the Wizard control.
This is the place where you have to Put this event.
//---------------------------------------------------
this is listing 6-18
<asp:Wizard ID ="Wizard1" runat ="server" OnNextButtonClick ="Wizard1_NextButtonClick">
<WizardSteps>
<asp:WizardStep ID ="WizardStep1" runat ="server" Title ="Provide Personal Info">
Firt name:<br />
<asp:TextBox ID ="fnameTextBox" runat ="server"></asp:TextBox><br />
Last Name:<br />
<asp:TextBox ID ="lnameTextBox" runat ="server"></asp:TextBox><br />
Email:<br />
<asp:TextBox ID ="emailTextBox" runat ="server"></asp:TextBox><br />
</asp:WizardStep>
<asp:WizardStep ID ="WizardStep2" runat ="server" Title ="Membership Information">
Are you already member of a group?<br />
<asp:RadioButton ID ="RadioButton1" runat ="server" Text ="Yes" GroupName ="Member" />
<asp:RadioButton ID ="RadioButton2" runat ="server" Text ="No" GroupName ="Member" />
</asp:WizardStep>
<asp:WizardStep ID ="MemberStep" runat ="server"
Title ="Provide Membership Number">
Membership Number<br />
<asp:TextBox ID ="mNumberTextBox" runat ="server"></asp:TextBox>
</asp:WizardStep>
<asp:WizardStep ID ="WizardStep3" runat ="server" Title ="Provided Information" StepType ="Complete" OnActivate ="WizardStep3_Activate">
<asp:Label ID ="Label1" runat ="server"></asp:Label>
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
//-----------------------------------------------------
Now ERRATA say's :Page 211 Delete line in Code Block.
Grey code block at top, next to last line:
What line!? There is no need to delete nothing!
all you have to do, is to keep the Original code as-is(listing6-19)+ add WizardStep3_Activate EVENT from previous listing(6-17)
<script runat="server">
void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
{
if (e.NextStepIndex == 2)
{
if (RadioButton1.Checked == true)
{
Wizard1.ActiveStepIndex = 2;
}
else
{
Wizard1.ActiveStepIndex = 3;
}
}
}
//this is for the FINISH BUTTON to show our Results remember?(listing6-17)
protected void WizardStep3_Activate(object sender, System.EventArgs e)
{
Label1.Text = "First name: " + fnameTextBox.Text.ToString() + "<br />" +
"Last name: " + lnameTextBox.Text.ToString() + "<br />" +
"Email: " + emailTextBox.Text.ToString();
}
</script>
|