SPMobilePageContents Class

Specifies the ID of the entry point <RenderingTemplate> that is used when rendering the main contents of a mobile Web page.

Inheritance Hierarchy


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


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


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

An SPMobilePageContents object appears in the <SPMobileForm> element of a mobile Web page. It specifies the entry point into the relevant portion of the MobileDefaultTemplates.ascx file located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\CONTROLTEMPLATES.

If the page type is HomePage, the DefaultTemplateName property holds the ID of the <RenderingTemplate>. For all other page types, the TemplateName property holds the ID of the <RenderingTemplate>.


The following excerpt from mbllists.aspx, the list-of-lists page for mobile Web sites in SharePoint Foundation, shows a SPMobilePageContents in use.

<!-- Page declaration and other matter omitted -->
<SPMobile:SPMobileForm RunAt="Server" PageType="HomePage" Paginate="true">
  <!-- matter omitted -->
  <SPMobile:SPMobilePageContents RunAt="Server" />

Because the page type is a home page, the value of the DefaultTemplateName property, "MobileHomePageContents", identifies the entry point <RenderingTemplate> in MobileDefaultTemplates.ascx. The following excerpt from that file shows that the MobileHomePageContents <RenderingTemplate> calls a SPMobileWebContents control.

<SharePoint:RenderingTemplate RunAt="Server" id="MobileHomePageContents">
    <SPMobile:SPMobileWebContents RunAt="Server" />

The SPMobileWebContents control, in turn, identifies a more specific <RenderingTemplate> ID: IntendedPageUse_WebSiteType_HomePage_Contents, where the placeholders IntendedPageUse and WebSiteType are defined as in Mobile Page Rendering System.

If there is no <RenderingTemplate> with the specified name in an .ascx file in the ...\CONTROLTEMPLATES folder, the runtime uses the <RenderingTemplate> named IntendedPageUse_Default_HomePage_Contents.

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


SPMobilePageContents Members

Microsoft.SharePoint.MobileControls Namespace

Other Resources

Mobile Page Rendering System