Udostępnij za pośrednictwem


SPMobileWebTitle Class

Specifies the ID of the <RenderingTemplate> that is used when rendering the header area of a mobile 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.SPMobileWebTemplateSelector
            Microsoft.SharePoint.MobileControls.SPMobileWebTitle

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 SPMobileWebTitle _
    Inherits SPMobileWebTemplateSelector
'Usage
Dim instance As SPMobileWebTitle
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class SPMobileWebTitle : SPMobileWebTemplateSelector

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 SPMobileWebTitle in your code. It is documented to provide further understanding of how mobile Web pages are rendered and how the rendering can be customized.

For information on the rendering of the title area of pages other than the home page, see SPMobileListTitle.

The <RenderingTemplate> ID takes the following form.

IntendedPageUse_WebSiteType_PageType_Title

The placeholders IntendedPageUse and WebSiteType are defined as in Mobile Page Rendering System,

The PageType is the type of page, such as HomePage or NewForm. For all practical purposes, in SharePoint Foundation, this part of the ID is always HomePage.

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

The following excerpt from the MobileDefaultTemplates.ascx file (in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\CONTROLTEMPLATES) ) shows how the SPMobileWebTitle is called by the “MobileHomePageTitle” rendering template.

<SharePoint:RenderingTemplate RunAt="Server" ID="MobileHomePageTitle">
  <Template>
    <SPMobile:SPMobileWebTitle RunAt="Server" />
  </Template>
</SharePoint:RenderingTemplate>

The following excerpt from the same file shows one of the built-in rendering templates that might be called, in turn, by the SPMobileWebNavigation object:

<SharePoint:RenderingTemplate RunAt="Server" id="Mobile_STS_HomePage_Title">
  <Template>
    <mobile:LiteralText RunAt="Server" 
       Text="<%$Resources:wss, viewlsts_pagetitle_doclist%>" 
       BreakAfter="false" />
    <mobile:LiteralText RunAt="Server" 
       Text="<%$Resources:wss, mobile_listtitle_separator%>" 
       BreakAfter="false" />
    <WPMobile:WebPartMobilePageTitle RunAt="Server" />
  </Template>
</SharePoint:RenderingTemplate>

If a template with the matching name cannot be found for a specific IntendedPageUse and WebSiteType the IntendedPageUse_Default_HomePage_Title <RenderingTemplate> is used.

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 .aspx file in the ...\CONTROLTEMPLATES folder that contains a <RenderingTemplate> with the name IntendedPageUse_WebSiteType_PageType_Title. Specify an intended page use, such as WebPartMobile for IntendedPageUse. Specify the name of a <Template Element (Site)>, such as STS, SGS, or BLOG, (or the ID of a <Template Element (Site)> for a custom site definition) in place of WebSiteType. Your custom <RenderingTemplate> then calls a combination of controls different from those used by IntendedPageUse_Default_HomePage_Title to render the header. (Otherwise the customization would be pointless.)

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

For more about customizing Web page titles, see Walkthrough: Customizing a Mobile Home Page.

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

SPMobileWebTitle Members

Microsoft.SharePoint.MobileControls Namespace

Other Resources

Mobile Page Rendering System

Understanding WebTemp*.xml Files

Walkthrough: Customizing a Mobile Home Page