• Thread Rating
    Rate this Thread
    Double click on boxes to rate this thread
  • Validations controls in ASP.NET
  • There are 6 validations controls in ASP.NET
    1) RequiredFieldValidator - as the name suggests, this control makes sure that
    the input box is not left blank.
    2) CompareValidator - This control validates values in two controls, and checks
    for equality
    3) RangeValidator - This validation control makes sure that the value entered in
    the control falls within a range specified. This specification may be done using its
    4) RegularExpression - Based on a regular expression, values entered in an
    input box must match the ones specified by this control's RegulareExpression
    5) CustomValidator - This type of validator control may be customized &
    created by a developer as per need
    6) ValidationSummary - This control may be used to show the summary of the
    information gathered using rest of the other validation controls
    To use a validation control, set a validation control on a form. Associate it with a
    server control by using its ControlToValidate property. Note that the server
    control has a property called CausesValidation and this is set to true for the
    validation control to trigger. This property is true by default for every server
    control. The validation control also has an ErrorMessage property that is
    assigned some text to explain what the error is, in case the validation control is
    trigerred. The validation control actually calls a client-side script that comes with
    ASP.NET, and this script does the job of validation for us. All this validation is
    done client-side.
    By Sri - Sep 04 2009 Reply » Save » Print »

Login to post your reply