DisplayAttribute.Description Propriedade

Definição

Obtém ou define um valor usado para exibir uma descrição na interface do usuário.Gets or sets a value that is used to display a description in the UI.

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

Valor da propriedade

String

Um valor usado para exibir uma descrição na interface do usuário.The value that is used to display a description in the UI.

Exemplos

O exemplo a seguir mostra como definir a Description propriedade.The following example shows how to set the Description property.

[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  

Comentários

Não use essa propriedade para obter o valor da Description propriedade.Do not use this property to get the value of the Description property. Use o método GetDescription em seu lugar.Use the GetDescription method instead.

A Description propriedade normalmente é usada como um elemento de dica de ferramenta ou descrição da interface do usuário que está associado ao membro usando esse atributo.The Description property is typically used as a tooltip or description UI element that is bound to the member using this attribute. O modelo Edit. ascx Dados Dinâmicos exibirá a descrição como uma dica de ferramenta nos campos de entrada de texto.The Dynamic Data Edit.ascx template will display the description as a tooltip in text-entry fields. Um null valor ou uma cadeia de caracteres vazia é válida.A null value or empty string is valid.

Aplica-se a