ASP.NET validation controls define an important role in validating the user input data. Whenever the user gives the input, it must always be validated before sending it across to various layers of an application. If we get the user input with validation, then chances are that we are sending the wrong data. So, validation is a good idea to do whenever we are taking input from the user.
There are the following two types of validation in ASP.NET,
- Client-Side Validation
- Server-Side Validation
- Client-Side Validation
When validation is done on the client browser, then it is known as Client-Side Validation. We use JavaScript to do the Client-Side Validation.
Server-Side Validation
When validation occurs on the server, then it is known as Server-Side Validation. Server-Side Validation is a secure form of validation. The main advantage of Server-Side Validation is if the user somehow bypasses the Client-Side Validation, we can still catch the problem on server-side.
The following are the Validation Controls in ASP.NET,
- RequiredFieldValidator Control
- CompareValidator Control
- RangeValidator Control
- RegularExpressionValidator Control
- CustomFieldValidator Control
- ValidationSummary