ValidationAttribute.Validate Method
Determines whether the specified object is valid and throws a ValidationException if the object is not valid.
Namespace: System.ComponentModel.DataAnnotations
Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)
'Declaration Public Sub Validate ( _ value As Object, _ validationContext As ValidationContext _ )
Parameters
- value
- Type: System.Object
The object to validate.
- validationContext
- Type: System.ComponentModel.DataAnnotations.ValidationContext
An object that contains information about the validation request.
| Exception | Condition |
|---|---|
| ArgumentNullException | validationContext is Nothing. |
| ValidationException | value is not valid. |
When you create a class that derives from the ValidationAttribute class, override the IsValid method to provide the customized validation logic. The Validate method calls the IsValid method to determine if the value is valid.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Community Additions
ADD
Show: