【发布时间】:2012-04-15 05:03:57
【问题描述】:
我已关注this guide,了解如何在 Sharepoint 2010 中创建移动 Web 部件,但当我使用移动设备访问该页面或使用“/m”-url 时未列出任何内容。关于如何为 Sharepoint 2010 的可视 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”文件中的“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 Assembly="MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=be5098001a913377" Namespace="MyProject.MyOrderList" TypeName="*" Safe="True" SafeAgainstScript="False" />
基本上,我只想创建一个可视化 Web 部件的简化版本,而不必创建一个仅用于移动访问的全新 Web 部件,而我应该能够完成此适配器方法。
谢谢。
【问题讨论】:
标签: mobile sharepoint-2010 web-parts adapter