Hi All,
I'm having problems getting a custom validator to work. I'm hoping someone
could perhaps notice what I've missed. I only want to provide a server side
validation method. The problem is basically that the method that I've designated
as the validation routine never gets called so I can't do anything about
potentially duff data.
I've declared the custom control as:
<asp:customvalidator id=valDoB runat="server" controltovalidate="txtDoB"
errormessage="Please ensure a valid date has been provided in the DoB field"
onservervalidate="valDoB_ServerValidate" EnableClientScript="False">*</asp:customvalidator>
Then I have a method called valDob_ServerValidate
public void valDoB_ServerValidate(object source, System.Web.UI.WebControls.ServerValidateEventArgs
args) {
if(txtDoB.Text == String.Empty){
valDoB.ErrorMessage = "Please ensure that the DoB field has been filled
in";
}
}
If anyone can spot what I've missed I would be very greatful
Thanks all
tce