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 section of a page.
As described earlier in the Mobile page rendering mechanism section, a Microsoft.SharePoint.MobileControls.SPMobileListContents template picker control is invoked and passed through a chain call, Finally find the controls that are displayed on the page.
Based on the current list type, this object determines what Renderingtemplate controls will render in the content section of the mobile home page. The control searches for the Renderingtemplate object name mobile_listtypeid_view_contents, where Listtypeid can be the ID number of a list definition or a Splisttemplatetype enumeration value. If the ID does not exist, the Renderingtemplate object with ID mobile_default_view_contents is used.
Windows SharePoint Services 3.0 does not have a built-in ID of mobile_announcements_view_contents (or mobile_104_view_contents, which refers to the same list type) Renderingtemplate class object. In this walkthrough, you will create a to add a greeting message on the notification list.
Steps
In a text editor, create a text file (UTF-8), named Announcementsviewpagecontents.ascx. stored in the Local_drive:\program Files\Common Files\Microsoft Shared\Web Server Extensions\12\template\controltemplates directory.
Add the following points to markup 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" %>