p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/asp-net-2-0-professional-215/)
-   -   Wizard Step (http://p2p.wrox.com/asp-net-2-0-professional/44346-wizard-step.html)

ziwez0 June 22nd, 2006 07:22 AM

Wizard Step
 
I seem to having difficulty with Chapter 6 (6-18 : 6-19)
ive modified it to fit to what i need it for.
I want my users to enter a pin before they can complete creating account, if they enter the pin incorrect then i want them to go no futher, but at the mo it allows them to move onto the next step:

Code(.aspx)

<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" OnNextButtonClick="CreateUserWizard1_NextButtonCli ck">
        <WizardSteps>
            <asp:CreateUserWizardStep runat="server">
            </asp:CreateUserWizardStep>
            <asp:WizardStep runat="server" Title="VerifyPin">
                <asp:TextBox ID="TextBox1" runat="server" Width="92px"></asp:TextBox>
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            </asp:WizardStep>
            <asp:WizardStep runat="server" Title="justlooking">
            </asp:WizardStep>
            <asp:CompleteWizardStep runat="server">
            </asp:CompleteWizardStep>
        </WizardSteps>
    </asp:CreateUserWizard>
</asp:Content>

Code (aspx.cs)

protected void CreateUserWizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {

        if (e.NextStepIndex == 1)
        {
            if (TextBox1.Text == "123456")
            {
                CreateUserWizard1.ActiveStepIndex = 2;


            }

            else
            {
                Label1.Text = "Incorrect";
                CreateUserWizard1.ActiveStepIndex = 0;
            }
        }

please help!!


ziwez0 June 22nd, 2006 08:25 AM

Opps sorted it

should be

if (e.NextStepIndex == 2)
        {.....




All times are GMT -4. The time now is 02:34 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.