Shared Validator Attributes

All of the validation controls share a base set of properties and methods. As you go though this chapter, you will see us use them in nearly every example, so we thought it prudent to go over these first. The following quick reference lists and discusses the eight we will be using most often (for a list of all, see the BaseValidator class):

  • ControlToValidate The ID property of the control you wish to have validated by the validation control.

  • IsValid A Boolean value (true or false) indicating whether or not the control which is being validated is valid. True if valid and false if not.

  • ErrorMessage The error message you want displayed to the user if the control is found to be invalid.

  • Text The inner contents of the control. ...

Get Programming Data-Driven Web Applications with ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.