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.


Both ErrorMessageResourceName and ErrorMessage are set.


Neither ErrorMessageResourceName nor ErrorMessage is set.


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.


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