views:

34

answers:

0

Hi,

I've followed this guide on how to create mobile web parts in Sharepoint 2010, but no content is listed when I access the page with a mobile device, or use the "/m"-url. Are there any other sources on how to create a mobile adapter for visual web parts for Sharepoint 2010?

My adapter-class looks like this:

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

using Microsoft.SharePoint.WebPartPages;
using Microsoft.SharePoint;
using Microsoft.SharePoint.MobileControls;

namespace MyProject.MyOrderList
{
   public class MyOrderListMobileAdapter : WebPartMobileAdapter
   {
    protected override void CreateControlsForDetailView()
    {
        Microsoft.SharePoint.MobileControls.SPMobileLabel lblHello = new Microsoft.SharePoint.MobileControls.SPMobileLabel();
        lblHello.Text = "Hello World. This is the Mobile version of the SharePoint web part.";
        Controls.Add(lblHello);                       
    }
  }
}

I've also added an entry to the "controlAdapters" in the "compat.browser"-file:

<adapter controlType="MyProject.MyOrderList, MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=be5098001a913377" 
                 adapterType="MyProject.MyOrderList.MyOrderListMobileAdapter, MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=be5098001a913377" />            

The safecontrol-entry looks like this:

<SafeControl Assembly="MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=be5098001a913377" Namespace="MyProject.MyOrderList" TypeName="*" Safe="True" SafeAgainstScript="False" />

Basicly I want to just create a simplified version of my visual web part without having to create a whole new web part that's just for mobile access, which is what I should be able to accomplish this adapter-method.

Thanks.