Export (0) Print
Expand All

ValidationAttribute.ErrorMessageResourceName Property

Gets or sets the error message resource name to use as lookup for the ErrorMessageResourceType if a validation fails.

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

public string ErrorMessageResourceName { get; set; }

Property Value

Type: System.String
The error message resource associated with a validation control.

ExceptionCondition
InvalidOperationException

If the ValidationAttribute is already in explicit mode or if you set the property multiple times.

ArgumentException

If the value of error message is null.

This property specifies the error message resource that is associated with a validation control. You can use this property to specify a resource file that contains localizable error messages.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5 SP1

Community Additions

ADD
Show:
© 2014 Microsoft