Hi, I have a problem with a data collection wizard.
My wizard has a number of client side validators, (regex, required field etc.) and they all work fine.
I have just added a CustomValidator to one of the controls, that is calling some server side code. (unfortunaltely it does have to be server side).
My problem is that this code seems to be called after the wizard has moved on to the next step (or is in the process of moving).
Thus, the fact that it returns false for the validation is of little use to me...
I am adding the Validator dynamically as part of my InitControl method as follows:
mustUploadAnImageValidator = new CustomValidator();
mustUploadAnImageValidator.ControlToValidate = radioButtonList.ID;
mustUploadAnImageValidator.ValidationGroup = "wizardGroup";
mustUploadAnImageValidator.ErrorMessage = "You must select a valid gallery image to use";
mustUploadAnImageValidator.Display = ValidatorDisplay.Static;
mustUploadAnImageValidator.ServerValidate +=
new ServerValidateEventHandler(mustUploadAnImageValidator_ServerValidate);
mustUploadAnImageValidator.CssClass = "galleryValidationMessageTop";
This works for all other validators, but I can't figure out why the wizard is moving on before my server validation returns.
I've added a javaScript pop-up, called from the server side method, which basically says "I'm not valid" & this appears just after the screen moves on.
Any suggestions gratefully recieved.