ValidationRule

Wisej.Web.ValidationRule

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Represents a validation rule within an instance of the Validation extender.

public class ValidationRule

Constructors

ValidationRule()

Initializes a new instance of a ValidationRule implementation.

ValidationRule(name, invalidMessage)

Initializes a new instance of a ValidationRule implementation using the specified name and optional invalidMessage .

Name
Type
Description

name

Name of the validation rule.

invalidMessage

Error message related to the validation rule.

Properties

Enabled

Boolean: Enables or disables the validation rule. Since 3.2.7 (Default: True)

ErrorProvider

IErrorProvider: Returns or sets the control that displays the InvalidMessage string. (Default: null)

InvalidMessage

String: Returns or sets the error message for the validation rule. (Default: null)

Name

String: Returns or sets the name of the validation rule. (Default: null)

Methods

OnControlCreated(control)

Invoked when the control associated with the validation rule is created and ready to be rendered on the client.

Parameter
Type
Description

control

Control being created.

The ControlCreated event is fired when the control is made visible the first time and it's ready to be displayed on the client browser; it's not fire when the control is constructed. Use this overload if your custom ValidationRule needs to read or set properties on the control itself. i.e. set the Filter, or format strings.

OnValidated(control)

Invoke after the control has been validated successfully.

Parameter
Type
Description

control

Control that validated successfully.

OnValidating(control)

Invoked when the control is being validated.

Parameter
Type
Description

control

Control being validated.

Returns: Boolean. true if the validation is successful; otherwise false.

Inherited By

Name
Description

Validates the control using a custom Regex expression.

Validates controls that cannot be left empty.

Validates telephone numbers.

Validates decimal values.

Validates currency values.

Validates long integer values.

Validates email addresses.

Last updated