Hi all,
There seems to be a complete black hole in the net when it comes to information about subclassing BaseValidator..
I have a webform with a bunch of textboxes I need to validate. Some are required text fields, others are date fields that are required, must be valid dates, and are in an expected format.
Im using the RequiredFieldValidator for the first and decided to create my own Validator for the second type, the DateValidator.
The EvaluateIsValid method of my DateValidator simply checks if the value exists and is a valid date (and I plan on using a regexp to check the format).
The problems are these:
1) My DateValidator works and displays its ErrorMessage when appropriate, but does not appear in a ValidationSummary list with ShowMessageBox=true
2) If i have any other standard validator present on the page (eg. the previously mentioned RequiredFieldValidator) that validator is processed first and, if it returns IsValid=false, the DateValidator does not validate. As far as I can tell, the EvaluateIsValid method is never called.
Ive spent a day looking for the missing bracket or closing tag but I just cant seem to figure it out..
If no one else has had similar problems, Ill post the code and see if someone can reproduce it.
Many thanks..
Fade
(the rapidly balding..)
There seems to be a complete black hole in the net when it comes to information about subclassing BaseValidator..
I have a webform with a bunch of textboxes I need to validate. Some are required text fields, others are date fields that are required, must be valid dates, and are in an expected format.
Im using the RequiredFieldValidator for the first and decided to create my own Validator for the second type, the DateValidator.
The EvaluateIsValid method of my DateValidator simply checks if the value exists and is a valid date (and I plan on using a regexp to check the format).
The problems are these:
1) My DateValidator works and displays its ErrorMessage when appropriate, but does not appear in a ValidationSummary list with ShowMessageBox=true
2) If i have any other standard validator present on the page (eg. the previously mentioned RequiredFieldValidator) that validator is processed first and, if it returns IsValid=false, the DateValidator does not validate. As far as I can tell, the EvaluateIsValid method is never called.
Ive spent a day looking for the missing bracket or closing tag but I just cant seem to figure it out..
If no one else has had similar problems, Ill post the code and see if someone can reproduce it.
Many thanks..
Fade
(the rapidly balding..)