【问题标题】:How to determine if Toolpart is running inside SharePoint Designer如何确定 Toolpart 是否在 SharePoint Designer 中运行
【发布时间】:2009-11-25 01:16:16
【问题描述】:

当在 SharePoint Designer 等设计器中运行时,Web 部件不能使用某些对象,例如 Best Practice to create designer friendly server controls 中详述的 Page.Request。

您可以使用DesignMode 属性来确定Web 部件是否在设计器中运行并采取适当的行动。

但这似乎不适用于 Toolparts - 它总是返回 false。

如何确定工具部件是否在 SharePoint Designer 中运行?

【问题讨论】:

    标签: sharepoint sharepoint-designer


    【解决方案1】:

    我们需要Toolpane.InCustomToolpane 属性

    所以从工具面板代码中

    this.ParentToolPane.InCustomToolPane
    

    顺便说一句 - 我认为这种差异的原因(尽管它的原因很糟糕)是 Web 部件页面被加载到从 Visual Studio (Whidbey) 获取的设计器中,如 msdb 博客中所述,但工具部件已加载进入浏览器窗口。

    【讨论】:

      猜你喜欢
      • 2011-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-02
      • 2023-03-09
      • 2012-09-17
      • 2010-10-26
      相关资源
      最近更新 更多