DataAnnotationsModelValidator DataAnnotationsModelValidator DataAnnotationsModelValidator Class

Definition

Provides a model validator.

public class DataAnnotationsModelValidator : System.Web.Mvc.ModelValidator
type DataAnnotationsModelValidator = class
    inherit ModelValidator
Public Class DataAnnotationsModelValidator
Inherits ModelValidator
Inheritance
DataAnnotationsModelValidatorDataAnnotationsModelValidatorDataAnnotationsModelValidator
Derived

Constructors

DataAnnotationsModelValidator(ModelMetadata, ControllerContext, ValidationAttribute) DataAnnotationsModelValidator(ModelMetadata, ControllerContext, ValidationAttribute) DataAnnotationsModelValidator(ModelMetadata, ControllerContext, ValidationAttribute)

Initializes a new instance of the DataAnnotationsModelValidator class.

Properties

Attribute Attribute Attribute

Gets the validation attribute for the model validator.

ControllerContext ControllerContext ControllerContext

Gets the controller context.

(Inherited from ModelValidator)
ErrorMessage ErrorMessage ErrorMessage

Gets the error message for the validation failure.

IsRequired IsRequired IsRequired

Gets a value that indicates whether model validation is required.

Metadata Metadata Metadata

Gets the metadata for the model validator.

(Inherited from ModelValidator)

Methods

GetClientValidationRules() GetClientValidationRules() GetClientValidationRules()

Retrieves a collection of client validation rules.

Validate(Object) Validate(Object) Validate(Object)

Returns a list of validation error messages for the model.

Applies to