Aracılığıyla paylaş


DisplayAttribute.Prompt Özellik

Tanım

Kullanıcı arabirimindeki istemler için filigranı ayarlamak için kullanılacak değeri alır veya ayarlar.

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

Özellik Değeri

Kullanıcı arabiriminde filigran görüntülemek için kullanılacak değer.

Örnekler

Aşağıdaki örnekte özelliğin "Soyadını Prompt Girin" olarak nasıl ayarlanacağı gösterilmektedir.

[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

Açıklamalar

Bu özellik genellikle bu öznitelikle ek açıklama ekleyen özelliğe bağlı bir ui öğesi için istem veya filigran olarak kullanılır. İstem dizesine erişmek için bu yöntemi kullanmayın. GetPrompt Bunun yerine bu yöntemi kullanın.

Şunlara uygulanır