共用方式為


SPMobileListTitle Class

Specifies the ID of the <RenderingTemplate> that is used when rendering the header area of a mobile page or form other than the home page.

Inheritance Hierarchy

System.Object
  System.Web.UI.Control
    System.Web.UI.MobileControls.MobileControl
      Microsoft.SharePoint.MobileControls.SPMobileComponent
        Microsoft.SharePoint.MobileControls.SPMobileTemplateSelector
          Microsoft.SharePoint.MobileControls.SPMobileListTemplateSelector
            Microsoft.SharePoint.MobileControls.SPMobileListTitle

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

Syntax

'Declaration
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class SPMobileListTitle _
    Inherits SPMobileListTemplateSelector
'Usage
Dim instance As SPMobileListTitle
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class SPMobileListTitle : SPMobileListTemplateSelector

Remarks

For an overview of the role of this class in the page rendering system for mobile devices, see Mobile Page Rendering System.

Do not call SPMobileListTitle in your code. It is documented to provide further understanding of how mobile Web pages are rendered and how the rendering can be customized.

The <RenderingTemplate> ID takes the following form.

IntendedListUse_ListTemplateID_PageType_ Title

The placeholders IntendedListUse, ListTemplateID, and PageType are defined in Mobile Page Rendering System.

The "Title" indicates that <RenderingTemplate> should apply to the header part of the page.

Hence, the SPMobileListTitle object for an announcements list view page on a mobile Web site is the following.

Mobile_104_View_Title

Alternatively, it could be the following.

Mobile_Announcements_View_Title

As it happens, when SharePoint Foundation is installed, there is initially no defined <RenderingTemplate> (for mobile page headers) for any specific list type, not even the built-in types. All pages use the Mobile_Default_PageType_Title <RenderingTemplate>. For example, as the following excerpt from the MobileDefaultTemplates.ascx file (in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\CONTROLTEMPLATES) shows, when the page type is View, the Mobile_Default_View_Title <RenderingTemplate> is used regardless of the Web site type. (The Mobile_Default_View_Title template calls SPMobileListTitleControl to render a title.)

<SharePoint:RenderingTemplate RunAt="Server" ID="MobileViewTitle">
  <Template>
    <SPMobile:SPMobileListTitle RunAt="Server" />
  </Template>
</SharePoint:RenderingTemplate>
<SharePoint:RenderingTemplate RunAt="Server" 
  ID="Mobile_Default_View_Title">
  <Template>
    <SPMobile:SPMobileListTitleControl RunAt="Server" />
  </Template>
</SharePoint:RenderingTemplate>

Do not change MobileDefaultTemplates.ascx or GbwMobileDefaultTemplates.ascx. To customize the rendering of the header for a particular page type of a particular Web site type, create a custom .ascx file in the ...\CONTROLTEMPLATES folder that contains a <RenderingTemplate> with the name Mobile_ListTemplateID_PageType_Title. Specify the ID (or Name) of a <ListTemplate Element (List Template)> in place of ListTemplateID. Also specify a particular PageType. The latter must be one of the following: "DeletePage", "DispForm", "EditForm", "NewForm", or "View". Your custom <RenderingTemplate> then calls an alternative to SPMobileListTitleControl to render the header.

The runtime automatically gives preference to your custom <RenderingTemplate> over the Mobile_Default_PageType_Title <RenderingTemplate> in MobileDefaultTemplates.ascx or GbwMobileDefaultTemplates.ascx.

For more about customizing Web page titles for built-in SharePoint Foundation page types other than home pages, see Walkthrough: Customizing a Mobile List View Page.

For title rendering on custom page types, see SPMobilePageTitle.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPMobileListTitle Members

Microsoft.SharePoint.MobileControls Namespace

SPMoblePageTitle

Other Resources

Mobile Page Rendering System

Walkthrough: Customizing a Mobile List View Page