I have problem: I have a custom validator on my page which validates imieTextbox control. But it's not working. And I don't know why.
This method comes from register.aspx.cs file:
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
//of course here will be other validation logic but setting IsValid property ti false is for example
args.IsValid = false;
}
And this comes fromregister.aspx file:
<asp:CustomValidator ID="CustomValidator1" runat="server"
ControlToValidate="imieTextbox" Display="Dynamic"
ErrorMessage="CustomValidator"
onservervalidate="CustomValidator1_ServerValidate" ValidateEmptyText="True"
ValidationGroup="A"></asp:CustomValidator>
Submit button on Page has property CausesValidation set to TRUE and has Validation group A (like all validators on my page). All validators(requiredfield validators) works fine, but custom validators is not. Why is that? What am I doing wrong?