AlternateTemplate property

TemplateBasedControl.AlternateTemplate property

Gets or sets the template that renders the control in contexts, such as a particular form, in which rendering the control with the Template property would be inappropriate.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public ITemplate AlternateTemplate { get; set; }

Property value

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

If the AlternateTemplate property is not set, the property returns the template named by the AlternateTemplateName property. (If the latter property is not specifically set, it returns the value of the DefaultAlternateTemplateName property.)

Notes to callers

The set accessor for the AlternateTemplate property does not set the value for the AlternateTemplateName property. For this reason, the two property values could be logically inconsistent. Consider leaving the AlternateTemplate property unset and instead, set the value of the AlternateTemplateName property. In this way, you are indirectly setting the value of the AlternateTemplate property.

© 2016 Microsoft