System.Web.UI.TemplateInstanceAttribute Class

Defines a metadata attribute that is used to specify the number of allowed instances of a template. This class cannot be inherited.

See Also: TemplateInstanceAttribute Members


public sealed class TemplateInstanceAttribute : Attribute


The System.Web.UI.TemplateInstanceAttribute class allows you to mark a template property as one that allows single or multiple instantiations. A template that only allows a single instantiation can have the controls that are contained inside of it referenced. The System.Web.UI.WebControls.WebParts.WebPartZone.ZoneTemplate property is an example of a property that can be instantiated only one time.

This System.Web.UI.TemplateInstanceAttribute class is optional. If a template property is not extended with a System.Web.UI.TemplateInstanceAttribute class, the default value, the TemplateInstanceAttribute.Multiple field, is used. For more information about using attributes, see Extending Metadata Using Attributes.


Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0