Skip to main content
Version: 4.1

RequiredValidationRule

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Validates controls that cannot be left empty.

public class RequiredValidationRule : ValidationRule

Constructors

Instance member RequiredValidationRule()

Initializes a new instance of the RequiredValidationRule class.

Properties

Instance member MinimumLength

Nullable<Int32>: Returns or sets the required minimum number of characters. (Default: null)

Instance member Name

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

Instance member Required

Boolean: Returns or sets whether the control can be empty or its required to have a value. (Default: True)

Instance member Trim

Boolean: Returns or sets whether empty controls with spaces are considered empty and fail validation. (Default: True)

Methods

Instance member OnValidating(control)

Validates the control using the validation rule.

ParameterTypeDescription
controlControl

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