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

Syntax

[System.AttributeUsage(System.AttributeTargets.Property)]
public sealed class TemplateInstanceAttribute : Attribute

Remarks

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.

Requirements

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