AuthorizationAttribute.ErrorMessage Property

[WCF RIA Services Version 1 Service Pack 2 is compatible with either .NET framework 4 or .NET Framework 4.5, and with either Silverlight 4 or Silverlight 5.]

Gets or sets the literal error message or resource key intended to be returned in an ErrorMessage.

Namespace:  System.ComponentModel.DataAnnotations
Assembly:  System.ServiceModel.DomainServices.Server (in System.ServiceModel.DomainServices.Server.dll)

Syntax

'Declaration
Public Property ErrorMessage As String
    Get
    Set
'Usage
Dim instance As AuthorizationAttribute
Dim value As String

value = instance.ErrorMessage

instance.ErrorMessage = value
public string ErrorMessage { get; set; }
public:
property String^ ErrorMessage {
    String^ get ();
    void set (String^ value);
}
member ErrorMessage : string with get, set
function get ErrorMessage () : String
function set ErrorMessage (value : String)

Property Value

Type: System.String
A literal string or a resource key.

Remarks

This property is meant to be set in the attribute declaration, and it serves as either a literal string or as a resource key. If ResourceType is non-null, this value is interpreted as the name of a property declared in ResourceType that will return the actual error message at run time. This is the mechanism that allows localization of error messages. If ResourceType is nulla null reference (Nothing in Visual Basic), this value is assumed to be a literal non-localized error message.

See Also

Reference

AuthorizationAttribute Class

System.ComponentModel.DataAnnotations Namespace