Validating two user controls
This function either returns nothing when everything is ok or an object stating what went wrong.
A very common use case of a custom validator is to check wether the form matches the sanitization rules of the server, this means the validator checks if the characters your user puts into your form are allowed.
Besides that it could also limit the amount of requests to server as you would be able to catch 99% of the errors before submitting your form the server.
In one of my cases I had a cancel button on a panel on a form, so I had to set Causes Validation = false on the panel as well as the form.
In the end I did this programatically as it was simpler than going through all the forms...
Set the Xml Reader Settings object's Validation Type property to the value Validation Type.
Schema, indicating that we want the Xml Reader to perform validation with a schema as it reads an XML document.