TemplateContainerAttribute

TemplateContainerAttribute

System.Web.UI (system.web.dll)sealed class

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 sealed class TemplateContainerAttribute : Attribute { // Public Constructors    public TemplateContainerAttribute(Type containerType); // Public Instance Properties    public Type ContainerType{get; } }

Hierarchy

System.Object System.Attribute TemplateContainerAttribute

Valid On

Property



ASP. NET in a Nutshell
ASP.NET in a Nutshell, Second Edition
ISBN: 0596005202
EAN: 2147483647
Year: 2003
Pages: 873

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net