如何确定 Toolpart 是否正在 SharePoint Designer 中运行
Web 部件无法使用某些对象,例如 Page.Request,详见 在 SharePoint Designer 等设计器中运行时创建设计器友好的服务器控件的最佳实践。
您可以使用 DesignMode 属性确定 Web 部件是否在设计器内部运行并采取适当的操作。
然而,这似乎不适用于 Toolparts - 它总是返回 false。
如何确定 Toolpart 是否正在 SharePoint Designer 中运行?
A web part can't use certain objects such as Page.Request as detailed in Best Practice to create designer friendly server controls when running in a designer such as SharePoint Designer.
You can use the DesignMode property to determine if a web part is running inside a designer and act appropriately.
However this doesn't seem to work for Toolparts - it always returns false.
How do you determine if a Toolpart is running inside SharePoint Designer?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们需要 Toolpane.InCustomToolpane属性
所以从工具窗格代码来看它的
一个旁白 - 我认为这种差异的原因(尽管它是一个糟糕的原因)是Web部件页面加载到从Visual Studio(Whidbey)获取的设计器中,如msdb博客中提到的,但是工具部分被加载到浏览器窗口中。
We need the Toolpane.InCustomToolpane property
So from the toolpane code its
An aside - I think the reason for this difference (though its a poor reason) is that the web part page is loaded into a designer taken from Visual Studio (Whidbey) as mentioned in the msdb blog, but the toolpart is loaded into a browser window.