How to: Customize Data Field Appearance and Behavior in the Data Model

ASP.NET Dynamic Data includes field templates that render the UI for displaying and editing data fields. You can customize the UI by changing existing field templates and by creating new custom field templates.  

You can customize data field appearance and behavior by using custom field templates as follows: 

  • Applying the UIHintAttribute attribute to a data field in the data model. This instructs Dynamic Data to use specific custom field templates to process a data field.

  • Creating the corresponding custom field templates to render the UI for displaying and for editing a data field.

When you customize a data field in the data layer, as shown here, the customization applies globally to a Web site. Dynamic Data uses the custom field templates instead of the default templates (which are selected based on the data field intrinsic type) to display and modify the data field.

Alternatively, you can limit the customization to a single page. For more information, see How to: Customize the Layout of an Individual Table By Using a Custom Page Template.

Customizing a data field in the data layer requires several steps as explained in the video listed next. 

See a video that shows this feature: Watch.

See a run-time code example of this feature: Run.

- Michael Miele
ASP.NET User Education
This posting is provided "AS IS" with no warranties, and confers no rights.

Give Your Feedback on the Documentation

Help us improve the developer documentation by taking the Visual Studio and .NET Framework Content Survey.  This survey will give us a better understanding of the type of applications you are developing as well as how you use Help and how we can improve it. The survey takes only 10 minutes, and we appreciate your feedback.

Skip to main content