DisplayAttribute.Prompt Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that will be used to set the watermark for prompts in the 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
Property Value
A value that will be used to display a watermark in the UI.
Examples
The following example shows how to set the Prompt property to "Enter Last Name".
[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
Remarks
This property is typically used as a prompt or watermark for a UI element that is bound to the property that is annotated with this attribute. Do not use this method to access the prompt string. Use the GetPrompt method instead.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기