检测页面已加载到 Sharepoint Designer 中

发布于 2024-08-11 23:54:10 字数 52 浏览 5 评论 0原文

Web 部件是否有办法确定托管页面正在加载到 SharePoint Designer 中?

Is there a way for a web part to figure out the hosting page is being loaded into SharePoint Designer ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

稚气少女 2024-08-18 23:54:10

检查 Web 部件控件的 DesignMode 属性 - 如果在 SPD 中打开,则该属性为 true。这应该适用于所有 ASP.NET 控件。

Check the web part control's DesignMode property—it's true if it's open in SPD. This should work for all ASP.NET controls.

你在看孤独的风景 2024-08-18 23:54:10

假设 WSS 3.0 / MOSS 2007,是:

SPContext.Current.IsRemoteAuthoringTime

或者,根据您的上下文,

SPContext.Current.IsDesigntime

更新:更粗略的方法可能是查看 HttpRequest 标头 - 我确信 SPD 发送了一个标头。

-奥辛

Assuming WSS 3.0 / MOSS 2007, Yes:

SPContext.Current.IsRemoteAuthoringTime

or, depending on your context,

SPContext.Current.IsDesigntime

Update: A cruder way might be to peek at the HttpRequest headers - I'm sure SPD sents a header.

-Oisin

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文