Export (0) Print
Expand All

ValidationAttribute.ErrorMessageString Property

Gets the localized or non-localized error message.

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

protected string ErrorMessageString { get; }

Property Value

Type: System.String
The localized or non-localized error message.

ExceptionCondition
InvalidOperationException

Both ErrorMessageResourceName and ErrorMessage are set.

-or-

Neither ErrorMessageResourceName nor ErrorMessage is set.

-or-

Either ErrorMessageResourceName or ErrorMessageResourceType is set, but the other is not.

If you set the ErrorMessageResourceName and ErrorMessageResourceType properties, the ErrorMessageString property contains the localized error message. If you set the ErrorMessage property, ErrorMessageString contains the non-localized error message.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft