Author: ynwa | Posted on: 11/4/2009 4:20:22 AM | Views : 644

I have an annoying little problem with a custom validator and i know it must be something silly. I have set it up to check the email address has not been edited to an address which doesnt not belong to my work place (2 domain names are allowed). Email address is editable textbox in a gridview.
My custom validator cuts the domain part of the address out and puts it into a variable called maildomain, and validates it like:
If maildomain = "@domain1" Or maildomain = "@domain2" Then e.IsValid = True Else e.IsValid = False End If
This works almost perfectly for me. If i enter an invalid domain the validator fires and cancels the update. However when i then click cancel, it saves the new value in the textbox to the gridview and table even if it not valid.
i have another custom validator to check if the address is already in use by a user on the system, ...

Go to the complete details ...