2010-09-20 63 views
0

我已按照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部件,仅用于移动访问,这是我应该能够完成此适配器方法。

谢谢。

回答

2

检查了这一点: 创建一个移动适配器为SharePoint 2010 http://allthingsdotnet.net/?p=603

他们不会让我发布多个超链接,那么下一个主题:

自VWP移动中不可见模式 使用与上述相同,以此作为查询字符串 - - ??p = 518

此外,还有一个新的应用程序可帮助为Web.Config和Compat.Browser中的安全控制部分创建正确的语法条目: 移动适配器工具:

ma.augustwind.com