Partager via


DisplayAttribute.Prompt Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets either a resource name or non-localized text, such as a watermark, that suggests a user action for an element that is bound to the member.

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

Syntax

'Declaration
Public Property Prompt As String
public string Prompt { get; set; }

Property Value

Type: System.String
Either a resource name or the non-localized text that suggests a user action for an element that is bound to the member. The resource name is used with the ResourceType property to retrieve localized text that suggests a user action for an element that is bound to the member.

Remarks

Set the Prompt property to either a literal non-localized string or to a resource key to use with the ResourceType property to specify a localized prompt.

Do not use the get accessor of the Prompt property to retrieve the text to display in your Silverlight application. Instead, use the GetPrompt method to retrieve the prompt to display. The GetPrompt method returns either the literal non-localized string or the localized string when a resource type is specified.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.