Windows Dev Center

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.

DataAnnotationsModelValidator Class

 

Provides a model validator.

Namespace:   System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)


public class DataAnnotationsModelValidator : ModelValidator

NameDescription
System_CAPS_pubmethodDataAnnotationsModelValidator(ModelMetadata, ControllerContext, ValidationAttribute)

Initializes a new instance of the DataAnnotationsModelValidator class.

NameDescription
System_CAPS_protpropertyAttribute

Gets the validation attribute for the model validator.

System_CAPS_protpropertyControllerContext

Gets the controller context.(Inherited from ModelValidator.)

System_CAPS_protpropertyErrorMessage

Gets the error message for the validation failure.

System_CAPS_pubpropertyIsRequired

Gets a value that indicates whether model validation is required.(Overrides ModelValidator.IsRequired.)

System_CAPS_protpropertyMetadata

Gets the metadata for the model validator.(Inherited from ModelValidator.)

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetClientValidationRules()

Retrieves a collection of client validation rules.(Overrides ModelValidator.GetClientValidationRules().)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodValidate(Object)

Returns a list of validation error messages for the model.(Overrides ModelValidator.Validate(Object).)

A model can have multiple validators. The DataAnnotationsModelValidator class represents the default model validator for ASP.NET MVC applications.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2015 Microsoft