ValidationAttribute.ErrorMessage 属性

定义

获取或设置一条在验证失败的情况下与验证控件关联的错误消息。Gets or sets an error message to associate with a validation control if validation fails.

public:
 property System::String ^ ErrorMessage { System::String ^ get(); void set(System::String ^ value); };
public string ErrorMessage { get; set; }
public string? ErrorMessage { get; set; }
member this.ErrorMessage : string with get, set
Public Property ErrorMessage As String

属性值

String

与验证控件关联的错误消息。The error message that is associated with the validation control.

注解

此属性是与验证控件关联的错误消息。This property is the error message that you associate with the validation control. 它用于未本地化的错误消息。It is used for non-localized error messages.

适用于