And why is it needed, please explain very "chewed."
I myself began to understand recently and I can tell you that validation is a rather necessary thing, and I would even say necessary. Validation is done so that the left side does not come from the client side. For example, an empty string or invalid characters for the password. Example: a login form containing a line for entering a name and password. You validate these 2 textboxes. Suppose a user left these two textboxes empty or filled out only one of them. Validators for these fields will not allow sending him a request to the server with this data (in my example it is an empty line). Or the user has entered Cyrillic characters in the password field or some other data that the server or client can skorit. Thus validators will allow you to cut off the initially incorrect data. I understand it so.
Further the integral result of validation is available through the property Page.IsValid.
Validators allow you to define declaratively
- What the user filled in the required fields
- That the data entered by the user fall into the desired range
- That the lines entered by the user have the desired format
- Any checks written by hand.
As far as I remember, all the results of validation are placed in a special control, which will be located in one place.
In a word, the validator checks whether the user entered the data correctly when registering on a particular site or when entering the mail ...