SPMobileComponent.TemplateName, propriété (Microsoft.SharePoint.MobileControls)

Gets or sets the ID attribute of a <RenderingTemplate> element that controls the rendering of the SPMobileComponent object.

Espace de noms : Microsoft.SharePoint.MobileControls
Assembly : Microsoft.SharePoint (dans microsoft.sharepoint.dll)

Syntaxe

'Déclaration
Public Overridable Property TemplateName As String
'Utilisation
Dim instance As SPMobileComponent
Dim value As String

value = instance.TemplateName

instance.TemplateName = value
public virtual string TemplateName { get; set; }

Valeur de la propriété

A String that represents the ID of a RenderingTemplate object. The default is the same value as DefaultTemplateName (which is null if not overridden). Hence, if your SPMobileComponent-derived component must have a RenderingTemplate, you must either override DefaultTemplateName, or TemplateName, or ensure that your code always sets TemplateName.

Notes

In the default implementation, the TemplateName property holds the value of the ID attribute of a <RenderingTemplate> element in either the file MobileDefaultTemplates.ascx located in C:\\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES or in a custom .ascx file in that same folder.

Also, in the default implementation, if Template is not explicitly set, but TemplateName is not null, Template returns the RenderingTemplate template named by TemplateName.

Setting TemplateName (with its default implementation) has the side effect of setting Template to return the RenderingTemplate template that is named by TemplateName.

On the other hand, setting Template directly does not set TemplateName to the name of the RenderingTemplate template that was assigned to Template. Thus, you can reduce the danger of inconsistent values by using TemplateName when you need to set RenderingTemplate.

If the values of Template and TemplateName are inconsistent, Template determines the RenderingTemplate template that is used to render the component.

Voir aussi

Référence

SPMobileComponent, classe
Membres SPMobileComponent
Microsoft.SharePoint.MobileControls, espace de noms