Name
TemplateContainerAttribute
Synopsis
This attribute is used when creating templated controls, which allow the control
user to specify a portion of the control’s user interface. This functionality is
implemented in controls like System.Web.UI.WebControls.Repeater
and System.Web.UI.WebControls.DataList
, which format bound data
according to specified templates. In these controls, and in any custom templated
controls you make, the TemplateContainerAttribute
is applied to every ITemplate
property. The attribute specifies the
type of the container control the template will be instantiated in, so that
casting is not required to evaluate data binding expressions. For example, the System.Web.UI.WebControls.DataList.ItemTemplate
property is a ITemplate
property that allows you to set or
retrieve the template for items in the list. This particular property has the
attribute <TemplateContainer(typeof(System.Web.UI.WebControls.DataListItem ))>
.
Public NotInheritable Class TemplateContainerAttribute : Inherits Attribute ' Public Constructors Public Sub New(ByVal containerType As Type) ' Public Instance Properties Public ReadOnly Property ContainerType As Type End Class
Hierarchy
System.Object→System.Attribute→ TemplateContainerAttribute
Valid On
Property
Get ASP.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.