UIHintAttribute Constructors

Definition

Initializes a new instance of the UIHintAttribute class.

Overloads

UIHintAttribute(String)

Initializes a new instance of the UIHintAttribute class by using a specified user control.

UIHintAttribute(String, String)

Initializes a new instance of the UIHintAttribute class using the specified user control and specified presentation layer.

UIHintAttribute(String, String, Object[])

Initializes a new instance of the UIHintAttribute class by using the specified user control, presentation layer, and control parameters.

UIHintAttribute(String)

Source:
UIHintAttribute.cs
Source:
UIHintAttribute.cs
Source:
UIHintAttribute.cs

Initializes a new instance of the UIHintAttribute class by using a specified user control.

C#
public UIHintAttribute(string uiHint);

Parameters

uiHint
String

The user control to use to display the data field.

Remarks

A UIHintAttribute object that is created with this constructor is initialized using the specified uiHint, which specifies the user control (field template) to use in order to display the data field.

ASP.NET Dynamic Data provides field templates, page templates, and data controls to render data fields in a data model. You can modify these templates and controls to customize them, or you can create a custom user control. If you create a custom user control, you use the UIHint property to specify the user control to use to display a data field.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0

UIHintAttribute(String, String)

Source:
UIHintAttribute.cs
Source:
UIHintAttribute.cs
Source:
UIHintAttribute.cs

Initializes a new instance of the UIHintAttribute class using the specified user control and specified presentation layer.

C#
public UIHintAttribute(string uiHint, string presentationLayer);
C#
public UIHintAttribute(string uiHint, string? presentationLayer);

Parameters

uiHint
String

The user control (field template) to use to display the data field.

presentationLayer
String

The presentation layer that uses the class. Can be set to "HTML", "Silverlight", "WPF", or "WinForms".

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0

UIHintAttribute(String, String, Object[])

Source:
UIHintAttribute.cs
Source:
UIHintAttribute.cs
Source:
UIHintAttribute.cs

Initializes a new instance of the UIHintAttribute class by using the specified user control, presentation layer, and control parameters.

C#
public UIHintAttribute(string uiHint, string presentationLayer, params object[] controlParameters);
C#
public UIHintAttribute(string uiHint, string? presentationLayer, params object?[]? controlParameters);

Parameters

uiHint
String

The user control (field template) to use to display the data field.

presentationLayer
String

The presentation layer that uses the class. Can be set to "HTML", "Silverlight", "WPF", or "WinForms".

controlParameters
Object[]

The object to use to retrieve values from any data sources.

Exceptions

ControlParameters is null or it is a constraint key.

-or-

The value of ControlParameters is not a string.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1 (package-provided)
UWP 10.0