This documentation is archived and is not being maintained.

UIHintAttribute::UIHint Property

Gets or sets the name of the field template to use to display the data field.

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

property String^ UIHint {
	String^ get ();

Property Value

Type: System::String
The name of the field template that displays the data field.

ASP.NET Dynamic Data provides field templates and page templates for rendering data fields in a data model. Field templates are user controls (.ascx files) that are mapped to data fields in the model. You can modify the default user controls that Dynamic Data provides, or you can create a custom user controls to use as field template. If you create a custom user control, you use the UIHint property on a property so that the property is rendered using the custom user control. The UIHint property specifies which field template to use when a specific column is rendered. The UIHint property can point to one of the templates provided in Dynamic Data or to a custom template. For example, you can create a custom field template named RedText_Edit.ascx, and then use the UIHint property to specify that the RedText_Edit.ascx control should be used to render a specified data field instead of the default Text_Edit.ascx template that is provided in Dynamic Data.

The following example shows how to specify that the UnitsInStock column in a database will be rendered by using the specified custom field template.

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

.NET Framework

Supported in: 4, 3.5 SP1

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.