Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ValidationAttribute::Validate Method (Object^, String^)

 

Validates the specified object.

Namespace:   System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

public:
void Validate(
	Object^ value,
	String^ name
)

Parameters

value
Type: System::Object^

The value of the object to validate.

name
Type: System::String^

The name to include in the error message.

Exception Condition
ValidationException

value is not valid.

This method validates the value of the object or property on which the ValidationAttribute attribute is declared. It calls the IsValid method and passes value as a parameter. If validation fails, a ValidationException exception is thrown.

Universal Windows Platform
Available since 10
.NET Framework
Available since 3.5
Return to top
Show:
© 2017 Microsoft