Export (0) Print
Expand All

DataAnnotationsModelValidatorProvider Class

Implements the default validation provider for ASP.NET MVC.

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

public class DataAnnotationsModelValidatorProvider : AssociatedValidatorProvider

The DataAnnotationsModelValidatorProvider type exposes the following members.

  NameDescription
Public methodDataAnnotationsModelValidatorProviderInitializes a new instance of the DataAnnotationsModelValidatorProvider class.
Top

  NameDescription
Public propertyStatic memberAddImplicitRequiredAttributeForValueTypesGets or sets a value that indicates whether non-nullable value types are required.
Top

  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodGetTypeDescriptorGets a type descriptor for the specified type. (Inherited from AssociatedValidatorProvider.)
Public methodGetValidators(ModelMetadata, ControllerContext)Gets the validators for the model using the metadata and controller context. (Inherited from AssociatedValidatorProvider.)
Protected methodGetValidators(ModelMetadata, ControllerContext, IEnumerable<Attribute>)Gets a list of validators. (Overrides AssociatedValidatorProvider.GetValidators(ModelMetadata, ControllerContext, IEnumerable<Attribute>).)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodStatic memberRegisterAdapterRegisters an adapter to provide client-side validation.
Public methodStatic memberRegisterAdapterFactoryRegisters an adapter factory for the validation provider.
Public methodStatic memberRegisterDefaultAdapterRegisters the default adapter.
Public methodStatic memberRegisterDefaultAdapterFactoryRegisters the default adapter factory.
Public methodStatic memberRegisterDefaultValidatableObjectAdapterRegisters an adapter to provide default object validation.
Public methodStatic memberRegisterDefaultValidatableObjectAdapterFactoryRegisters an adapter factory for the default object validation provider.
Public methodStatic memberRegisterValidatableObjectAdapterRegisters an adapter to provide object validation.
Public methodStatic memberRegisterValidatableObjectAdapterFactoryRegisters an adapter factory for the object validation provider.
Public methodToString (Inherited from Object.)
Top

A validation provider provides validators for the data model. This class is an implementation of the AssociatedValidatorProvider class. It provides validators for attributes which derive from ValidationAttribute and it provides a validator for types which implement IValidatableObject. To support client side validation, register adapters through the static methods of this class, or create validation attributes that implement IClientValidatable. The logic to support IClientValidatable is implemented in the DataAnnotationsModelValidator class.

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