diff --git a/xml/System.ComponentModel.DataAnnotations/UIHintAttribute.xml b/xml/System.ComponentModel.DataAnnotations/UIHintAttribute.xml index b706d369722..62c964b041e 100644 --- a/xml/System.ComponentModel.DataAnnotations/UIHintAttribute.xml +++ b/xml/System.ComponentModel.DataAnnotations/UIHintAttribute.xml @@ -411,9 +411,23 @@ property on a property so that the property is rendered using the custom user control. The property specifies which field template to use when a specific column is rendered. The 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 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. + 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 for **MVC**, `.cshtml` files for **Razor**) 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. + Having created a custom user control, + use the property on a property + so that the property will be rendered using your custom user control. + The property + specifies which field template to use when a specific column is rendered. + The property + can point to one of the templates provided in Dynamic Data or to a custom template. + For example, you can create custom field templates named `UnitsInStock.ascx` and `UnitsInStock_Edit.ascx` + and then use the property + to specify that the `UnitsInStock` control should be used to render a specified data field + instead of the default `Text` 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. + The following example shows how to specify + that the `UnitsInStock` column in a database will be rendered by using the specified custom field template. :::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_WebNet/DynamicData.CustomFieldTemplate/CS/Product.cs" id="Snippet5"::: :::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_WebNet/DynamicData.CustomFieldTemplate/VB/Products.vb" id="Snippet5":::