Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

TemplateBasedControl.ControlTemplate property

Gets the template that renders the control in the current context.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
protected virtual ITemplate ControlTemplate { get; }

Property value

Type: System.Web.UI.ITemplate
A ITemplate object that renders the control.

When this property is overridden in a derived class, the get accessor has logic that decides which one of the ITemplate type properties of the TemplateBasedControl object is actually used in the current context to render the field.

Notes to inheritors

The default implementation of the get accessor returns the value of the Template property in all contexts. If you need an AlternateTemplate property to render the control in certain contexts, such as a particular form, override the get accessor to include your selection logic.

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.