共用方式為


AuthorizationAttribute.ErrorMessage 屬性

取得或設定預定要在 ErrorMessage 中傳回的常值錯誤訊息或資源索引鍵。

命名空間: System.ComponentModel.DataAnnotations
組件: System.ServiceModel.DomainServices.Server (於 system.servicemodel.domainservices.server.dll)

使用方式

'用途
Dim instance As AuthorizationAttribute
Dim value As String

value = instance.ErrorMessage

instance.ErrorMessage = value

語法

'宣告
Public Property ErrorMessage As String
public string ErrorMessage { get; set; }
public:
property String^ ErrorMessage {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_ErrorMessage ()

/** @property */
public void set_ErrorMessage (String value)
public function get ErrorMessage () : String

public function set ErrorMessage (value : String)

屬性值

常值字串或資源索引鍵。

備註

這個屬性 (Property) 預定要在屬性 (Attribute) 宣告中設定,而且當做常值字串或資源索引鍵。如果 ResourceType 不是 null,這個值會解譯為 ResourceType 中宣告的屬性名稱,該屬性名稱會在執行階段傳回實際的錯誤訊息。這是允許當地語系化錯誤訊息的機制。如果 ResourceTypenull,這個值會假定為非當地語系化的常值錯誤訊息。

執行緒安全性

任何這個類型的公用靜態 (在 Visual Basic 中為 共用) 成員都具備執行緒安全。 不保證任何執行個體成員安全執行緒。

平台

開發平台

Windows XP Home Edition, Windows XP Professional, Windows Server 2003 、Windows Server 2008 和 Windows 2000

目標平台

另請參閱

參考

AuthorizationAttribute 類別
AuthorizationAttribute 成員
System.ComponentModel.DataAnnotations 命名空間