다음을 통해 공유


SPMobilePageTitle.DefaultTemplateName Property

Gets the value of the ID attribute of the <RenderingTemplate> element that defines the rendering of the title when the control is on the home page on a mobile Web site.

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

Syntax

'Declaration
Public Overrides ReadOnly Property DefaultTemplateName As String
    Get
'Usage
Dim instance As SPMobilePageTitle
Dim value As String

value = instance.DefaultTemplateName
public override string DefaultTemplateName { get; }

Property Value

Type: System.String
A String that represents the ID of the template for the title of the home page.

Remarks

In SharePoint Foundation this property always returns "MobileHomePageTitle". This is the value of the ID attribute of a <RenderingTemplate> element in the file MobileDefaultTemplates.ascx or GbwMobileDefaultTemplates.ascx located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\CONTROLTEMPLATES.

You must not modify MobileDefaultTemplates.ascx or GbwMobileDefaultTemplates.ascx. To customize the rendering of the home page title, create another <RenderingTemplate> element in a new .ascx file in the ...\CONTROLTEMPLATES folder. Give your new <RenderingTemplate> element an ID value that is descriptive but likely to be unique. For example, you could add your company name to the end of the ID, such as "MobileHomePageTitleMyCompanyInc". Then derive a new class from SPMobileComponent (the same parent as SPMobilePageTitle), and override its DefaultTemplateName property so that it returns your custom ID. Add an object of the new class to the <HeaderTemplate> element of a mobile Web page.

Contrast the DefaultTemplateName property with the TemplateName property which specifies the <RenderingTemplate> when the page is not the home page of the mobile web site.

See Also

Reference

SPMobilePageTitle Class

SPMobilePageTitle Members

Microsoft.SharePoint.MobileControls Namespace