Defines a metadata attribute that is used to specify the number of allowed instances of a template. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
The 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 ZoneTemplate property is an example of a property that can be instantiated only one time.
This class is optional. If a template property is not extended with a class, the default value, the Multiple field, is used. For more information about using attributes, see Extending Metadata Using Attributes.
The following code example demonstrates how to use the TemplateInstance enumeration and the class. A custom LoginView control named MyLoginViewA overrides the AnonymousTemplate property and uses the class to specify that only one instance of the AnonymousTemplate property is created.
The following code example is an ASPX file that uses the MyLoginViewA control and demonstrates how to access properties of the class.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.