Stop Wizard from progressing to next step.

D

David Lozzi

Howdy,

I have a wizard to retrieve lost passwords on my site. The first page asks
for their username then they click Next. On the next click I have the
validation against the database to see whether or not its a valid username.
If its not, I'm displaying a little message that its incorrect, but the
wizard continues to the next step anyway. It will display the error message
(page control outside of wizard) but also display step 2. I've tried adding
both of these lines to my click function but neither works, how do I get
around this?

Protected Sub wzRecover_NextButtonClick(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.WizardNavigationEventArgs) Handles
wzRecover.NextButtonClick

Select Case wzRecover.ActiveStepIndex

Case 0

If Not DoesEmailExist(UCase(txtEmail.Text)) Then

lblError.Text = "Email address does not exist. Please enter a valid email
address."

wzRecover.ActiveStepIndex = 0
OR
wzRecover.MoveTo(WizardStep1)

Exit Sub

End If

Case 1

Case 2

End Select

End Sub



Thanks!!

David Lozzi
 
C

Cowboy \(Gregory A. Beamer\)

You have to use the event for the middle of the step and change e.Cancel to
true. That will stop forwarding.
 
D

David Lozzi

What? Middle of the step? e.Cancel? Can you be a little more specific?

Thanks,

David Lozzi
 
Joined
Jan 20, 2011
Messages
1
Reaction score
0
easy

to get the logic of it

protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
{
if (Wizard1.ActiveStepIndex == 0)
{
if (comecondition == true)
{
e.Cancel = true;
}​
}​
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top