Remember that real verification should always be performed on the server. All that you do on the client side is simply optimization to save several trips around the environment.
The easiest way to keep client-side and server-side validation in sync with ASP.Net is to use validation elements. Validation elements will check both on the client side and on the server side, so that when verification fails on the client, it is never sent to the server.
If you want to do something that is not provided for by standard validation elements, you should either use CustomValidator or inherit your own control from BaseValidator.
source
share