Rediger

Del via


DisplayAttribute.Description Property

Definition

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

Property Value

The value that is used to display a description in the UI.

Examples

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  

Remarks

Do not use this property to get the value of the Description property. Use the GetDescription method instead.

The Description property is typically used as a tooltip or description UI element that is bound to the member using this attribute. The Dynamic Data Edit.ascx template will display the description as a tooltip in text-entry fields. A null value or empty string is valid.

Applies to