RequiredValidationRule
Namespace: Wisej.Web
Assembly: Wisej.Framework (3.5.0.0)
Validates controls that cannot be left empty.
- C#
- VB.NET
public class RequiredValidationRule : ValidationRule
Public Class RequiredValidationRule
Inherits ValidationRule
Constructors
RequiredValidationRule()
Initializes a new instance of the RequiredValidationRule class.
Properties
MinimumLength
Nullable<Int32>: Returns or sets the required minimum number of characters. (Default: null)
Name
String: Returns or sets the name of the validation rule. (Default: "Required")
Required
Boolean: Returns or sets whether the control can be empty or its required to have a value. (Default: True)
Trim
Boolean: Returns or sets whether empty controls with spaces are considered empty and fail validation. (Default: True)
Methods
OnValidating(control)
Validates the control using the validation rule.
| Parameter | Type | Description |
|---|---|---|
| control | Control |
Returns: Boolean. true if the validation is successful; otherwise false.