Wss3sdk: Procedure for customizing a mobile list view page

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, Microsoft. Sharepoint. mobilecontrols. spmobilelistcontents The template selector control is called, and a chain is called to find the control displayed on the page.

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 = "Cancelistitemseparator"   />
    </ Template >
  5. Save and close the file.

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

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

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

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.