Custom Mobile List View

Source: Internet
Author: User

This walkthrough will show you how to customize the mobile list view page by implementing a custom RenderingTemplate control. The following example shows how to customize the content of a page.
As described in the previous section on mobile page rendering mechanism, a Microsoft. sharePoint. mobileControls. the SPMobileListContents template selector control is called, and the control displayed on the page is finally found through a chain call.

Based on the current list type, this object determines whatRenderingTemplateThe widget is rendered in the content section of the mobile homepage. Search for this controlRenderingTemplateObject NameMobile _ListTypeID_ View_Contents, WhereListTypeIDIt can be the ID number defined by a list orSPListTemplateTypeEnumeration value. If this ID does not existMobile_Default_View_ContentsOfRenderingTemplateObject.

Windows SharePoint Services 3.0 does not have the built-in IDMobile_Announcements_View_Contents(OrMobile_pai_view_contents, Which refers to the same list type)RenderingTemplateClass Object. In this drill, you will create one to add a greeting message to the notification list.

Procedure
    1. In the text editor, create a text file (UTF-8) namedAnnouncementsViewPageContents.ascx. Stored in Local_Drive: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ CONTROLTEMPLATESDirectory.

    2. Add the following points to the tag to the file:

      <%@ Control Language="C#" %>    <%@ Assembly     Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>    <%@ Register     TagPrefix="mobile"     Namespace="System.Web.UI.MobileControls"     Assembly="System.Web.Mobile, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" %>    <%@ Register     TagPrefix="SharePoint"     Namespace="Microsoft.SharePoint.WebControls"     Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>    <%@ Register     TagPrefix="SPMobile"     Namespace="Microsoft.SharePoint.MobileControls"     Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>    <%@ Import Namespace="Microsoft.SharePoint" %>

      3. Then, addRenderingTemplateObject, set its IDViewTheSPMobileWebTitleObject ID:Mobile_pai_view_contents.

      <SharePoint:RenderingTemplate ID="Mobile_104_View_Contents" RunAt="Server" ></SharePoint:RenderingTemplate>

       

      4. InRenderingTemplateDefineTemplateElement to containLabelChild widget. Set the label attributes as follows:

      <Template>     <SPMobile:SPMobileControlContainer RunAt="Server">     <SPMobile:SPMobileComponent RunAt="Server" TemplateName="MobileViewPicker" />     <SPMobile:SPMobileComponent RunAt="Server" TemplateName="MobileDefaultSeparator" />     </SPMobile:SPMobileControlContainer>     <mobile:Label RunAt="Server" Text="Hello SharePoint Mobile User!"/>     <SPMobile:SPMobileListItemIterator     RunAt="Server" ListItemSeparatorTemplateName="MobileListItemSeparator" />     </Template>
        1. Save and close the file.

        2. ReSTART Internet Information Services (IIS ). You can use the iisreset command in the command line to restart IIS.

        3. If you are using a device simulator on your computer, rather than a real mobile device, you may also need to delete Temporary Internet Files.

        4. Navigate to a notification list from your device or simulator. You will see the greeting information at the top of the list, as shown on the screen below:

           

           

      Reproduced http://www.cnblogs.com/Sunmoonfire/archive/2008/07/21/1247898.html

       

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.