DisplayAttribute.Prompt 속성

정의

UI에서 프롬프트 워터마크를 설정하는 데 사용할 값을 가져오거나 설정합니다.

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

속성 값

UI에 워터마크를 표시하는 데 사용할 값입니다.

예제

다음 예제에서는 설정 하는 방법에 설명 합니다 Prompt 속성을 "성 입력" 합니다.

[MetadataType(typeof(EmployeeMD))]  
public partial class Employee {  
    public class EmployeeMD {  
        [Display(Name = "Last Name", Order = -9,   
        Prompt = "Enter Last Name", Description="Emp Last Name")]  
        public object LastName { get; set; }  

        [Display(Name = "Manager", AutoGenerateFilter=false)]  
        public object Employee1 { get; set; }  
    }  
}  
<MetadataType(GetType(EmployeeMD))>  _  
Public Class Employee  

    Public Class EmployeeMD  

        <Display(Name:="Last Name", Order:=-9, _  
           Prompt:="Enter Last Name", Description:="Emp Last Name")>  _  
        Public Property LastName As Object  
        End Property  

        <Display(Name:="Manager", AutoGenerateFilter:=false)>  _  
        Public Property Employee1 As Object  
        End Property  
    End Class  
End Class  

설명

이 속성은 일반적으로 이 특성으로 주석이 추가된 속성에 바인딩된 UI 요소에 대한 프롬프트 또는 워터마크로 사용됩니다. 이 메서드를 사용하여 프롬프트 문자열에 액세스하지 마세요. 대신 GetPrompt 메서드를 사용합니다.

적용 대상