共用方式為


SPMobileComponent.Template Property

Gets or sets the template that controls rendering of the SPMobileComponent object.

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

Syntax

'Declaration
Public Overridable Property Template As ITemplate
    Get
    Set
'Usage
Dim instance As SPMobileComponent
Dim value As ITemplate

value = instance.Template

instance.Template = value
public virtual ITemplate Template { get; set; }

Property Value

Type: System.Web.UI.ITemplate
An ITemplate that controls the rendering of the SPMobileComponent object. The default is the ITemplate object that is named by TemplateName.

Remarks

In the default implementation, if Template is not explicitly set, but TemplateName is not a null reference (Nothing in Visual Basic), Template returns the RenderingTemplate object named by TemplateName.

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

However, 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 the RenderingTemplate object.

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

See Also

Reference

SPMobileComponent Class

SPMobileComponent Members

Microsoft.SharePoint.MobileControls Namespace