C
Craig Buchanan
I'm using the Wizard control in the 2.0 framework. I need to perform a
validation on each of the steps of the wizard in the Finish button click
event. This scenario would occur if the user clicked the Finished
navigation link, then the Finish button, bypassing the validation that
occurs on each page.
In the Finish button's click event, I perform the validation of the previous
pages. I would like to go to the first page with invalid data using the
MoveTo() method. The code in the Finish button resembles:
If Not UserControl.IsValid Then
e.Cancel = True
Me.Wizard1.MoveTo(Me.Wizard1.WizardStep2)
Exit Sub
End If
The MoveTo() method does move to the desired step and the ActiveStepChanged
event fires. Unfortunately, after the Exit Sub line, the ActiveStepChanged
event fires again, where the ActiveStepIndex is the Finished page. Moving
the e.Cancel line after the MoveTo() doesn't have an effect.
What am I missing?
Thanks in advance.
Craig Buchanan
validation on each of the steps of the wizard in the Finish button click
event. This scenario would occur if the user clicked the Finished
navigation link, then the Finish button, bypassing the validation that
occurs on each page.
In the Finish button's click event, I perform the validation of the previous
pages. I would like to go to the first page with invalid data using the
MoveTo() method. The code in the Finish button resembles:
If Not UserControl.IsValid Then
e.Cancel = True
Me.Wizard1.MoveTo(Me.Wizard1.WizardStep2)
Exit Sub
End If
The MoveTo() method does move to the desired step and the ActiveStepChanged
event fires. Unfortunately, after the Exit Sub line, the ActiveStepChanged
event fires again, where the ActiveStepIndex is the Finished page. Moving
the e.Cancel line after the MoveTo() doesn't have an effect.
What am I missing?
Thanks in advance.
Craig Buchanan