Condividi tramite


TemplateBasedControl.AlternateTemplateName Property

Gets or sets the name of a rendering template that can be used in contexts in which the template named by the TemplateName property would be inappropriate.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Property AlternateTemplateName As String
    Get
    Set
'Usage
Dim instance As TemplateBasedControl
Dim value As String

value = instance.AlternateTemplateName

instance.AlternateTemplateName = value
public string AlternateTemplateName { get; set; }

Property Value

Type: System.String
A String object that represents the name of a rendering template that renders the control in special contexts. The default is a null reference (Nothing in Visual Basic).

Remarks

The AlternateTemplateName property returns the value of the DefaultAlternateTemplateName property if it has not been specifically set to something else.

Notes to Callers

Typically, calling code should set the AlternateTemplateName property to the value of the ID attribute of a <RenderingTemplate> element in an .ascx file that is located in the following folder:

%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\template\controltemplates

The ID attribute identifies the RenderingTemplate object that renders the control in contexts, such as on particular forms, in which using the template named by the TemplateName property would be inappropriate.

See Also

Reference

TemplateBasedControl Class

TemplateBasedControl Members

Microsoft.SharePoint.WebControls Namespace

Other Resources

How to: Create a Custom Field Type

Custom Field Types

Walkthrough: Creating a Custom Field Type