Custom Validation Control within Wizard Control 8(

Joined
Aug 28, 2007
Messages
4
Reaction score
0
I have a check box that I want to require the user to check before going to the next page of my wizard control.

All my other validations, such as a name text box that has a requiredfieldvalidator assigned to it fires on the click of the "next" button in the wizard control.

So, I added a custom validation control to the check box and when I debug I can see that my method is getting hit and the page is not valid is getting set to false, yet the wizard control still goes to the next page and the text for the custom validation control doesn't display.

Here is the code for the CustomValidator and when I debug, I do see that it is getting executed when the "next" button is hit in the wizard control, but the wizard control still goes to the next page rather then stop and require the required fields to be validated as it does for a textbox/requiredfieldvalidator.

protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
if (cbCodeOfConduct.Checked == false)
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}

Can anyone offer me any help on this?
Thanks so much,
JimmyL

EDIT:
In order to try to clarify more:
In page 2 of my wizard control I have a text box that has a required field validator assigned to it.
If the user clicks next in the wizard to go to page 3, the validator fires and they do not go to page 2 until they enter some text.

I want to do the same functionality with a check box. Right now I am trying to use the custom validation control to do it, but it isn't working.


Thanks again.
JimmyL
 
Last edited:

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top