Share via


SPMobilePageTitle.TemplateName Property

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

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

Syntax

Public Overrides ReadOnly Property TemplateName As String
    Get

Dim instance As SPMobilePageTitle
Dim value As String

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

Property Value

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

Remarks

The following table shows the value of this property for the different page types of a mobile Web site.

Page Type

Rendering Template

List View

"MobileViewTitle"

List View in a subfolder

"MobileViewTitleWithFolder"

New Item Form

"MobileNewFormTitle"

Edit Form

"MobileEditFormTitle"

Delete Item Form

"MobileDeletePageTitle"

Display Item Form

"MobileDispFormTitle"

Each of these strings is the value of the ID attribute of a <RenderingTemplate> element in the file MobileDefaultTemplates.ascx located in C:\\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES.

You must not modify MobileDefaultTemplates.ascx. To customize the rendering of a page title for a particular page type (such as the List View type), 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 "MobileViewTitleMyCompanyInc". Then derive a new class from SPMobileComponent (the same parent as SPMobilePageTitle), and override its TemplateName property so that it returns your custom ID when the page's PageType value is PAGE_VIEW. Add an object of the new class to the <HeaderTemplate> element of a mobile Web page.

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

See Also

Reference

SPMobilePageTitle Class

SPMobilePageTitle Members

Microsoft.SharePoint.MobileControls Namespace