SPMobileWebContents 类

指定呈现移动主页的主要内容区域时使用的 <RenderingTemplate> ID。

继承层次结构

System.Object
  System.Web.UI.Control
    System.Web.UI.WebControls.WebControl
      Microsoft.SharePoint.Mobile.WebControls.SPMobileComponent
        Microsoft.SharePoint.Mobile.WebControls.SPMobileTemplateSelector
          Microsoft.SharePoint.Mobile.WebControls.SPMobileWebTemplateSelector
            Microsoft.SharePoint.Mobile.WebControls.SPMobileWebContents

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

语法

声明
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class SPMobileWebContents _
    Inherits SPMobileWebTemplateSelector
用法
Dim instance As SPMobileWebContents
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class SPMobileWebContents : SPMobileWebTemplateSelector

备注

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

不要在代码中调用SPMobileWebContents 。记录提供呈现进一步了解如何移动网页和如何自定义呈现方式。

主要内容区域的呈现的页面而不是主页的信息,请参阅SPMobileListContents

<RenderingTemplate> ID 采用以下形式。

IntendedPageUse_WebSiteType_PageType_Contents

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

PageType是页面,例如主页或 NewForm 的类型。对于所有实际情况,在SharePoint Foundation,此 ID 的部件始终是主页。

"内容"指示该 <RenderingTemplate> 适用于页上的主要内容部分。

从MobileDefaultTemplates.ascx文件 (在%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\CONTROLTEMPLATES) 以下节选内容显示SPMobileWebContents由"MobileHomePageContents"呈现模板。

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

以下示例摘自同一文件显示一些可能会调用,接下来,由SPMobileWebContents对象的内置呈现模板:

<SharePoint:RenderingTemplate RunAt="Server" id="Mobile_Default_HomePage_Contents">
 <Template>
    <SPMobile:SPMobileComponent RunAt="Server" 
       TemplateName="Mobile_STS_HomePage_Contents" 
  </Template>
</SharePoint:RenderingTemplate>
<SharePoint:RenderingTemplate RunAt="Server" ID="Mobile_STS_HomePage_Contents">
  <Template>
    <SPMobile:SPMobileParentWebControls RunAt="Server" />
    <SPMobile:SPMobileGenericListIterator RunAt="Server" />
    <SPMobile:SPMobileLabel RunAt="Server" 
       Text="<%$Resources:wss, mobile_listcategory_workspaces_text%>" 
       BreakAfter="true" />
    <SPMobile:SPMobileSubWebControls RunAt="Server" />
  </Template>
</SharePoint:RenderingTemplate>

如果特定IntendedPageUse和WebSiteType找不到具有匹配的名称的模板,则使用IntendedPageUse_Default_HomePage_Contents <RenderingTemplate>。例如,博客网站的上下文中的SPMobileWebContents对象定义名为 Mobile_BLOG_HomePage_Contents 的模板。因为没有任何 <RenderingTemplate> 具有该名称,所以使用 Mobile_Default_HomePage_Contents <RenderingTemplate>。

不会更改MobileDefaultTemplates.ascx或GbwMobileDefaultTemplates.ascx。对于任何网站类型,如博客的尚不包含 <RenderingTemplate> MobileDefaultTemplates.ascx或GbwMobileDefaultTemplates.ascx中定义,您可以重写 Mobile_Default_HomePage_Contents <RenderingTemplate> 使用以下方法。

Create a custom *.ascx file in the ...\CONTROLTEMPLATES folder that contains a <RenderingTemplate> with the name IntendedPageUse_WebSiteType_HomePage_Contents. Specify the name of a <Template>, such as BLOG, (or the ID of a <Template> 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_Contents to render the contents. (Otherwise the customization would be pointless.)

运行时自动为首选项设置为您的自定义 <RenderingTemplate> 通过IntendedPageUse_Default_HomePage_Contents <RenderingTemplate> MobileDefaultTemplates.ascx或GbwMobileDefaultTemplates.ascx中提供了。

For more about customizing Web page main contents, see Walkthrough: Customizing the Mobile Home Page.

线程安全性

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

另请参阅

引用

SPMobileWebContents 成员

Microsoft.SharePoint.Mobile.WebControls 命名空间

其他资源

Mobile Page Rendering System

WebTemp.xml

Walkthrough: Customizing the Mobile Home Page