guitardave78
Programmer
Hi guys, I am trying to set up a custom validator but it does not seem to work. My required field validators all work but not this.
For the sake of testing the validator is being set to just return false
here is my code aspx
here is the c#
any ideas why this does not work?
For the sake of testing the validator is being set to just return false
here is my code aspx
Code:
<input type="text" id="ad_year" name="ad_year" runat="server" />
<asp:CustomValidator id="CustomValidator1"
ControlToValidate="ad_year"
OnServerValidate="ServerValidation"
ErrorMessage="Not a number!"
runat="server"/>
here is the c#
Code:
void ServerValidation (object source, ServerValidateEventArgs args)
{
args.IsValid = false;
}
any ideas why this does not work?