JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the BaseValidator Class

The BaseValidator class provides the basic implementation needed for all validation controls. Here is the inheritance hierarchy of this class:

Object
   Control
      WebControl
         Label
            BaseValidator

You can find the notable public properties of BaseValidator objects in Table 18.2 and their notable public methods in Table 18.3. (This class has no non-inherited events.) Note that as with other Web server controls, I am not listing the notable properties, methods, and events this class inherits from the Control and WebControl classes—you can find them in Chapter 15, Tables 15.1 to 15.5. This class also inherits the Label class; the Label class has only one non-inherited public member—the Text property.

Table 18.2: Noteworthy public properties of BaseValidator objects.

Property

Means

ControlToValidate

Gets/sets the data-entry control to validate.

Display

Gets/sets how error messages are displayed.

EnableClientScript

Gets/sets whether validation is enabled.

Enabled

Gets/sets whether the validator is enabled.

ErrorMessage

Gets/sets the error message text.

ForeColor

Gets/sets the color of the error message.

IsValid

Gets/sets whether the connected data-entry control is validated.

Table 18.3: Noteworthy public methods of BaseValidator objects.

Method

Means

Validate

Checks the connected data-entry control, as well as updating the IsValid property.

Related solution:

Found on page:

Using the Label Class

685

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor