For ASP.NET validation controls, I want to use both client-side validation for custom validation and server-side validation for protection against hackers. ASP.NET documentation allows me to believe that if EnableClientScript = "True", then server-side validation will not be performed if client-side validation is possible. To get confirmation on the server side, the documentation says that EnableClientScript = "False", which generally bypasses the client-side check.
I don’t understand how validator checks work? I ask, because it seems obvious that many developers would like to validate both client and server side together, and I find it hard to believe that both are impossible with one of the standard validation elements.
If I understand the ASP.NET documentation correctly, I can only find two options:
Use the two validation elements in exactly the same way, with the exception of their ID and EnableClientScript properties. Obviously ugly to maintain two controls is almost the same.
Write code to verify if postback then calls the Validate method in the validation group. Why write code behind if there is a way to be automatic with a control?
Is there a way to do this using a single validator validation element without code?
Thank you in advance for your entry.