ValidationAttribute.Validate Method
Validates an object or property on which the ValidationAttribute is declared.
Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)
Parameters
- value
- Type: System.Object
The value of the object on which a ValidationAttribute is declared.
- name
- Type: System.String
The name of the object or data field on which a ValidationAttribute is declared.
| Exception | Condition |
|---|---|
| ValidationException | Value is not valid. |
This method validates the value of the object or property on which the ValidationAttribute is declared. It calls the IsValid method using value as parameter. If the call fails, a ValidationException is thrown.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.