ValidationAttribute ValidationAttribute ValidationAttribute ValidationAttribute Constructors

Definition

Overloads

ValidationAttribute() ValidationAttribute() ValidationAttribute()

Initializes a new instance of the ValidationAttribute class.

ValidationAttribute(Func<String>) ValidationAttribute(Func<String>) ValidationAttribute(Func<String>) ValidationAttribute(Func<String>)

Initializes a new instance of the ValidationAttribute class by using the function that enables access to validation resources.

ValidationAttribute(String) ValidationAttribute(String) ValidationAttribute(String) ValidationAttribute(String)

Initializes a new instance of the ValidationAttribute class by using the error message to associate with a validation control.

ValidationAttribute() ValidationAttribute() ValidationAttribute()

Initializes a new instance of the ValidationAttribute class.

protected:
 ValidationAttribute();
protected ValidationAttribute ();
Protected Sub New ()

Remarks

Note to inheritors

This constructor chooses a very generic validation error message. Developers subclassing ValidationAttribute should use other constructors or supply a better message.

ValidationAttribute(Func<String>) ValidationAttribute(Func<String>) ValidationAttribute(Func<String>) ValidationAttribute(Func<String>)

Initializes a new instance of the ValidationAttribute class by using the function that enables access to validation resources.

protected:
 ValidationAttribute(Func<System::String ^> ^ errorMessageAccessor);
protected ValidationAttribute (Func<string> errorMessageAccessor);
new System.ComponentModel.DataAnnotations.ValidationAttribute : Func<string> -> System.ComponentModel.DataAnnotations.ValidationAttribute
Protected Sub New (errorMessageAccessor As Func(Of String))

Parameters

errorMessageAccessor
Func<String>

The function that enables access to validation resources.

Exceptions

Remarks

This constructor provides a resource accessor function that is used by the ErrorMessageString property to retrieve an error message.

ValidationAttribute(String) ValidationAttribute(String) ValidationAttribute(String) ValidationAttribute(String)

Initializes a new instance of the ValidationAttribute class by using the error message to associate with a validation control.

protected:
 ValidationAttribute(System::String ^ errorMessage);
protected ValidationAttribute (string errorMessage);
new System.ComponentModel.DataAnnotations.ValidationAttribute : string -> System.ComponentModel.DataAnnotations.ValidationAttribute
Protected Sub New (errorMessage As String)

Parameters

errorMessage
String String String String

The error message to associate with a validation control.

Applies to