我跟随this guide学习了如何在SharePoint2010中创建移动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”-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" />基本上,我只想创建一个简化版本的可视化web部件,而不必创建一个全新的web部件,它只用于移动访问,这是我应该能够完成的适配器方法。
谢谢。
发布于 2011-01-27 10:34:41
查看:为SharePoint 2010 http://allthingsdotnet.net/?p=603创建移动适配器
他们不允许我发布多个超链接,所以对于下一个主题:
此外,还有一个新的应用程序,它有助于为Web.Config和Compat.Browser entry中的安全控件部分创建正确的语法:移动适配器工具:
ma.augustwind.com
发布于 2012-04-15 05:03:57
MSDN动手实验室在开发移动web部件方面非常有帮助。
https://stackoverflow.com/questions/3750058
复制相似问题