SPMobileListContents, classe (Microsoft.SharePoint.MobileControls)

Windows SharePoint Services 3
Specifies the ID of the <RenderingTemplate> that is used when rendering the main content area of a mobile page or form other than the home page.

Espace de noms : Microsoft.SharePoint.MobileControls
Assembly : Microsoft.SharePoint (dans microsoft.sharepoint.dll)

[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 SPMobileListContents : SPMobileListTemplateSelector

For an overview of the role of this class in the page rendering system for mobile devices, see Système de rendu des pages mobiles.

Do not call SPMobileListContents in your code. It is documented to provide further understanding of how mobile Web pages are rendered and how the rendering can be customized.

The <RenderingTemplate> ID takes the following form.

Mobile_ListTemplateID_PageType_Contents

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

The "Contents" indicates that <RenderingTemplate> should apply to the main content area part of the page.

The PageType is the type of page, such as View or NewForm. It is never HomePage. For the rendering of the main content area of home pages, Windows SharePoint Services 3.0 uses SPMobileWebContents.

The ListTemplateID is the integer value of the Type attribute for the Langage CAML (Collaborative Application Markup Language) <ListTemplate, élément (Modèle de liste)> element or the value of the Name attribute. For example, the Type value for the announcements list template is 104. Hence, the SPMobileListContents object for an announcements list view page on a mobile Web site is the following.

Mobile_104_View_Contents

Alternatively, it could be the following.

Mobile_Announcements_View_Contents

The following excerpt from the MobileDefaultTemplates.ascx file (in C:\\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES) shows the markup that controls the rendering of main content areas when the page type is View. Notice that there is a specific template for only the Events list type. All other list types use the Mobile_Default_View_Contents <RenderingTemplate>.

<SharePoint:RenderingTemplate RunAt="Server" ID="MobileViewContents">
  <Template>
    <SPMobile:SPMobileListContents RunAt="Server" />
  </Template>
</SharePoint:RenderingTemplate>
<SharePoint:RenderingTemplate RunAt="Server" 
  ID="Mobile_Default_View_Contents">
  <Template>
    <SPMobile:SPMobileControlContainer RunAt="Server">
      <SPMobile:SPMobileComponent RunAt="Server" 
        TemplateName="MobileViewPicker" />
      <SPMobile:SPMobileComponent RunAt="Server" 
        TemplateName="MobileDefaultSeparator" />
    </SPMobile:SPMobileControlContainer>
    <SPMobile:SPMobileListItemIterator RunAt="Server" 
      ListItemSeparatorTemplateName="MobileListItemSeparator" />
  </Template>
</SharePoint:RenderingTemplate>
<SharePoint:RenderingTemplate RunAt="Server" 
  ID="Mobile_Events_View_Contents">
  <Template>
    <SPMobile:SPMobileControlContainer RunAt="Server">
      <SPMobile:SPMobileComponent RunAt="Server" 
        TemplateName="MobileViewPicker" />
      <SPMobile:SPMobileComponent RunAt="Server" 
        TemplateName="MobileDefaultSeparator" />
    </SPMobile:SPMobileControlContainer>
    <SPMobile:SPMobileEventsListItemIterator RunAt="Server" 
      ListItemSeparatorTemplateName="MobileListItemSeparator" />
  </Template>
</SharePoint:RenderingTemplate> 

Do not change MobileDefaultTemplates.ascx. For any combination of page type (other than the home page or a custom page) and list type that does not already have a <RenderingTemplate> defined in MobileDefaultTemplates.ascx, you can override the Mobile_Default_PageType_Contents <RenderingTemplate> with the following steps. (For main content area rendering on home pages, see SPMobileWebContents. For main content area rendering on custom page types, see SPMobilePageContents.)

Create a custom .aspx file in the ...\CONTROLTEMPLATES folder that contains a <RenderingTemplate> with the name Mobile_ListTemplateID_PageType_Contents. Specify the Type or Name of a <ListTemplate, élément (Modèle de liste)> in place of ListTemplateID. Also specify a particular PageType. The latter must be one of the following: "DeletePage", "DispForm", "EditForm", "NewForm", or "View". Your custom <RenderingTemplate> then calls a combination of controls different from those used by Mobile_Default_PageType_Contents to render the main content area. (Otherwise the customization would be pointless.)

The runtime automatically gives preference to your custom <RenderingTemplate> over the Mobile_Default_PageType_Contents <RenderingTemplate> in MobileDefaultTemplates.ascx.

For more about customizing Web page main content areas for built-in Windows SharePoint Services 3.0 page types other than home pages, see Procédure pas à pas : personnalisation d'une page mobile d'affichage de liste.

Les membres statiques publics de ce type (Shared en Visual Basic) sont sécurisés au niveau des threads. Il n'est pas garanti que les membres d'instance soient sécurisés au niveau des threads.
Afficher: