我已按照this guide了解如何在Sharepoint 2010中创建移动Web部件,但是当我使用移动设备访问该页面时未列出任何内容,或者使用“/米” -url。关于如何为Sharepoint 2010的可视Web部件创建移动适配器,是否还有其他来源?在Sharepoint 2010中为Visual Web部件创建“移动适配器”
我的适配器类看起来是这样的:
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);
}
}
}
我还添加在 “compat.browser” -file一个条目 “controlAdapters”:
<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" />
的的SafeControl -entry看起来是这样的:
<SafeControl Assembly="MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=be5098001a913377" Namespace="MyProject.MyOrderList" TypeName="*" Safe="True" SafeAgainstScript="False" />
Basicly我只想创造我的Visual Web部件的简化版本,没有^ h创建一个全新的Web部件,仅用于移动访问,这是我应该能够完成此适配器方法。
谢谢。