ASPNET Validations

Whenever we get an input from a user we may or may not get the correct information So we can make use of validation controls in order to put some validations on the client side So basically validation controls are here to validate the user input so that we can get the correct data. So what are all the validation controls let us see one by one
• RequiredFieldValidator
• RangeValidator
• CompareValidator
• RegularExpressionValidator
• CustomValidator
• Validation Summary
Therefore and so we must ensure that we set the validation accordingly based on its purpose and make it mandatory.

ASPNET Validations

RequiredFeildValidator
RequiredFieldValidator may be used when we wanted to make a TextBox mandatory. For instance if we open a page with personal details which shows first name and last name we can make the first name to be mandatory by setting RequiredFieldValidator whereas the second name is optional and RequiredFieldValidator need not to be set.
RangeValidator
RangeValidator is used when we want a data to be set in a particular range. For instance the data may be amount or bill or date or amount of currency to be set in particular range.
CompareValidator
Compare Validator is used to compare two Values. For example if we need to compare the values in password and confirm password and set both to be equal. CompareValidator can be set as equal to, less than as or greater than values.
RegularExpressionValidator
RegularExpressionValidator may be used when we want the input data to be in particular format. For instance take Email ID where the ID should be set in particular format as www and a dot and a @ symbol in that case we can make use of RegularExpressionValidator.
CustomValidator
CustomValidator is a one where we can define our own concept like what we want to validate.
ValidationSummary
ValidationSummary is a one that summarise all the validator as message either at the end of a page or as a text in a browser on a page or as an alert box.

  • ASPNET Server Controls
    ASPNET Server Controls
    ASP.NET provides web forms controls that are used to create HTML components. A tag written in a Web ...
  • ASPNET Application
    ASPNET Application
    ASP stands for Active Server Pages ASP and ASP.NET are server side technologies. Both technologie...