Skip to main content
Version: 4.1

ValidationRule

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

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

public class ValidationRule

Constructors​

Instance member ValidationRule()​

Initializes a new instance of a ValidationRule implementation.

Instance member ValidationRule(name, invalidMessage)​

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

NameTypeDescription
nameStringName of the validation rule.
invalidMessageStringError message related to the validation rule.

Properties​

Instance member Enabled​

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

Instance member ErrorProvider​

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

Instance member InvalidMessage​

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

Instance member Name​

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

Methods​

Instance member OnControlCreated(control)​

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

ParameterTypeDescription
controlControlControl 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.

Instance member OnValidated(control)​

Invoke after the control has been validated successfully.

ParameterTypeDescription
controlControlControl that validated successfully.

Instance member OnValidating(control)​

Invoked when the control is being validated.

ParameterTypeDescription
controlControlControl being validated.

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

Inherited By​

NameDescription
RegexValidationRuleValidates the control using a custom Regex expression.
RequiredValidationRuleValidates controls that cannot be left empty.
TelephoneValidationRuleValidates telephone numbers.
DecimalValidationRuleValidates decimal values.
CurrencyValidationRuleValidates currency values.
IntegerValidationRuleValidates long integer values.
EmailValidationRuleValidates email addresses.