User input validation can be done with ease with the help of ASP.NET Validation Sever Controls. Coding is not required at all because ready-made ASP.NET Validation Server Controls are present for use with just a drag and drop away.
ASP.NET Validation Server Controls are used to validate the input data through a form by a user of the web application. ASP.NET Validation Server Controls then checks if the input data by the user is validated and displays an error message if the validation fails.
Shown below is a code snipper of ASP.NET Validation Server Controls.
<asp:control_name id=”some_id” runat=”server” />
ASP.NET Validation Server Controls
- CompareValidator - takes an input value and then compares it with another input value or a fixed value
- CustomValidator - used to code your own validation methods to handle the data inputted by the user
- RangeValidator - checks a value input by a user against a range i.e. whether it is between two values
- RegularExpressionValidator - makes sure that the input value matches an already specified pattern
- RequiredFieldValidator - makes an input field a required field
- ValidationSummary - displays a report i.e. a summary of all validation errors occurred in a Web Page