SPMobilePageContents 类

指定呈现移动网页的主要内容时使用的入口点 <RenderingTemplate> 的 ID。

继承层次结构

System.Object
  System.Web.UI.Control
    System.Web.UI.WebControls.WebControl
      Microsoft.SharePoint.Mobile.WebControls.SPMobileComponent
        Microsoft.SharePoint.Mobile.WebControls.SPMobilePageContents

命名空间:  Microsoft.SharePoint.Mobile.WebControls
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class SPMobilePageContents _
    Inherits SPMobileComponent
用法
Dim instance As SPMobilePageContents
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, 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.

移动网页的 <SPMobileForm> 元素中出现SPMobilePageContents对象。指定位于%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\CONTROLTEMPLATES MobileDefaultTemplates.ascx文件的相关部分的入口点。

如果页面类型为主页, DefaultTemplateName属性将包含 <RenderingTemplate> 的 ID。对于所有其他页面类型, TemplateName属性包含 <RenderingTemplate> 的 ID。

示例

以下示例摘自mbllists.aspx,在SharePoint Foundation,移动的网站列表的列表页上显示正在使用SPMobilePageContents 。

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

页面类型是在主页上,因为DefaultTemplateName属性,"MobileHomePageContents"的值标识MobileDefaultTemplates.ascx中的入口点 <RenderingTemplate>。以下示例摘自该文件显示 MobileHomePageContents <RenderingTemplate> 调用SPMobileWebContents控件。

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

如果没有任何 <RenderingTemplate> 具有指定名称.ascx 文件中的...\CONTROLTEMPLATES文件夹中,运行时使用 <RenderingTemplate> 名为IntendedPageUse_Default_HomePage_Contents。

线程安全性

该类型的任何公共 静态 (已共享 在 Visual Basic 中) 成员都是线程安全的。不保证任何实例成员都是线程安全的。

另请参阅

引用

SPMobilePageContents 成员

Microsoft.SharePoint.Mobile.WebControls 命名空间

其他资源

Mobile Page Rendering System