Validation process to cancel New user Wizard step?

G

Guest

Hi

I have created a couple of CreateUserSteps infront of the default one. I use
control validators for most of the fields but in the State drop down list I
want to make sure the user has chosed a state or prov. The first row in the
drop down list is
"select state/prov" so I want to make sure that when they hit the next
button that has changed. I tried the Next(click_event) but even when the data
is not valid it changes screens to the next step. Is there a way to abort the
change and stay on the same step?

Thanks
 
N

Neutrino

In the NextButtonClick event of the Wizard control put the following
code:

protected void Wizard1_NextButtonClick(object sender,
WizardNavigationEventArgs e)
{
if (!IsValid)
{
e.Cancel = true;
}
}

That should do it. The WizardNavigationEventArgs passed to the event
handler has a property named Cancel that when set to true will abort
the navigation to the next step.

Hope this helps.
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top