System.ComponentModel.DataAnnotations 4.0.0.0 System.Attribute System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.All, AllowMultiple=true)

A Visual Studio project with source code is available to accompany this topic: Download.

MVC uses the class to associate a model with a data field. Dynamic Data uses the class to associate a user control with a data field. Dynamic Data uses the property to determine which user control to use in order to display a data field.

For more information about how to use attributes, see Extending Metadata Using Attributes.

Specifies the template or user control that Dynamic Data uses to display a data field.

- Constructor
  4.0.0.0

  A object that is created with this constructor is initialized using the specified , 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 property to specify the user control to use to display a data field.

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

  The user control to use to display the data field.
- Constructor
  4.0.0.0
  To be added.

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

  The user control (field template) to use to display the data field.
  The presentation layer that uses the class. Can be set to "HTML", "Silverlight", "WPF", or "WinForms".
- Constructor
  4.0.0.0
  System.ParamArray
  To be added.

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

  The user control (field template) to use to display the data field.
  The presentation layer that uses the class. Can be set to "HTML", "Silverlight", "WPF", or "WinForms".
  The object to use to retrieve values from any data sources.
- Property
  4.0.0.0
  System.Collections.Generic.IDictionary<System.String,System.Object> To be added.

  The property lets you retrieve data from a data model, tracks updates to the data model, and notifies the model of any changes.

  Gets or sets the object to use to retrieve values from any data source.

- Method
  4.0.0.0
  System.Boolean `` To be added.

  Gets a value that indicates whether this instance is equal to the specified object.

  true if the specified object is equal to this instance; otherwise, false.

  The object to compare with this instance, or a null reference.
- Method
  4.0.0.0
  System.Int32 To be added.

  Gets the hash code for the current instance of the attribute.

  The attribute instance hash code.

- Property
  4.0.0.0
  System.String To be added.

  This property represents the presentation layer that uses the class. This property can be set to "HTML", "Silverlight", "WPF", or "WinForms".

  Gets or sets the presentation layer that uses the class.

- Property
  4.0.0.0
  System.Object To be added. To be added.

  Gets the unique identifier for the attribute.

- Property
  4.0.0.0
  System.String To be added.

  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 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.

  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 reference: DynamicData.CustomFieldTemplate#5

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