Compartilhar via


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

System.Object
  System.Web.UI.Control
    System.Web.UI.MobileControls.MobileControl
      Microsoft.SharePoint.MobileControls.SPMobileComponent
        Microsoft.SharePoint.MobileControls.SPMobilePageContents

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

Syntax

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

Remarks

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>.

Examples

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" />
</SPMobile:SPMobileForm>

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">
  <Template>
    <SPMobile:SPMobileWebContents RunAt="Server" />
  </Template>
</SharePoint:RenderingTemplate>

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

Reference

SPMobilePageContents Members

Microsoft.SharePoint.MobileControls Namespace

Other Resources

Mobile Page Rendering System