【问题标题】:Creating a "Mobile Adapter" for Visual Web parts in Sharepoint 2010在 Sharepoint 2010 中为可视 Web 部件创建“移动适配器”
【发布时间】: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


    【解决方案1】:

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

    他们不允许我发布多个超链接,所以对于下一个主题:

    自定义 VWP 在移动模式下不可见 使用和上面一样,用 this 作为查询字符串 - - ?p=518

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

    ma.augustwind.com

    【讨论】:

      【解决方案2】:

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-09-28
        • 2011-12-30
        • 1970-01-01
        • 2012-07-25
        • 2013-06-02
        • 2013-07-15
        • 2012-05-22
        相关资源
        最近更新 更多