DisplayAttribute.Name Property

 

Gets or sets a value that is used for display in the UI.

Namespace:   System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

member Name : string with get, set

Property Value

Type: System.String

A value that is used for display in the UI.

Do not use this property to get the value of the Name property. Use the GetName method instead.

The name is typically used as the field label for a UI element that is bound to the property that is annotated with this attribute. The Dynamic Data List.aspx, ListDetails.aspx, and Details.aspx page templates use the Name property for the field label. A null value or empty string is valid.

The following example shows how to set the name property.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Return to top
Show: