ValidationAttribute.ErrorMessageResourceType 屬性

定義

取得或設定資源類型,此類型可在驗證失敗時用於查閱錯誤訊息。Gets or sets the resource type to use for error-message lookup if validation fails.

public:
 property Type ^ ErrorMessageResourceType { Type ^ get(); void set(Type ^ value); };
public Type ErrorMessageResourceType { get; set; }
public Type? ErrorMessageResourceType { get; set; }
member this.ErrorMessageResourceType : Type with get, set
Public Property ErrorMessageResourceType As Type

屬性值

Type

與驗證控制項相關聯的錯誤訊息類型。The type of error message that is associated with a validation control.

備註

您可以將 ErrorMessageResourceType 屬性與中的屬性搭配使用, ErrorMessageResourceName 以提供當地語系化的錯誤訊息。You use the ErrorMessageResourceType property together with the ErrorMessageResourceName property in to provide a localized error message.

適用於