Partager via


SPMobileWebTitle Class

Specifies, for a particular Web type (BLOG or STS, or a custom Web type), 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

<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
Public NotInheritable Class SPMobileWebTitle _
    Inherits SPMobileWebTemplateSelector

Dim instance As SPMobileWebTitle
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
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.

Mobile_WebSiteType_PageType_Title

The "Mobile" is a prefix that indicates that the <RenderingTemplate> is for mobile Web sites.

The WebSiteType portion of the ID is determined by the SPContext when the SPMobileWebTitle object is instantiated.

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

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

For built-in Web site types that ship with Windows SharePoint Services 3.0, the WebSiteType is the value of the Name attribute of the caml <Template Element (Site)> element (of the SharePoint WEBTEMP.XML file). For example, the Name value for the blog site definition is "BLOG". Hence, the SPMobileWebTitle object defines the following <RenderingTemplate> ID for a mobile blog home page.

Mobile_BLOG_HomePage_Title

For custom site definitions, the WebSiteType portion of the <RenderingTemplate>'s ID is the value of the ID attribute of the <Template Element (Site)> element (in a custom WEBTEMP*.XML file), not the Name attribute. Suppose you have a WEBTEMPMyCustomSiteDefinitions.XML file containing the following <Template Element (Site)> element.

<Template Name="MyFirstCustomSiteDefinition" ID="10001"> 

The SPMobileWebTitle object defines the following <RenderingTemplate> ID for the mobile home page.

Mobile_10001_HomePage_Title

As it happens, when Windows SharePoint Services 3.0 is installed, there is initially no defined <RenderingTemplate> (for mobile page headers) for any specific Web site 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 C:\\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES) shows, when the page type is HomePage, the Mobile_Default_HomePage_Title <RenderingTemplate> is used regardless of the Web site type. (The Mobile_Default_HomePage_Title template calls SPMobileWeb to render a title.)

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

Do not change MobileDefaultTemplates.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 Mobile_WebSiteType_PageType_Title. Specify the name of a <Template Element (Site)>, such as STS or BLOG, (or the ID of a <Template Element (Site)> for a custom site definition) in place of WebSiteType. Also specify a particular PageType. The latter must be one of the following: "DeletePage", "DispForm", "EditForm", "HomePage", "NewForm", or "View". Your custom <RenderingTemplate> then calls an alternative to SPMobileWeb to render the header.

The runtime automatically gives preference to your custom <RenderingTemplate> over the Mobile_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

WebTemp.xml

Walkthrough: Customizing a Mobile Home Page