开发者

How to determine if Toolpart is running inside SharePoint Designer

开发者 https://www.devze.com 2022-12-12 22:28 出处:网络
A web part can\'t use certain objects such as Page.Request as detailed in Best Practice to create desig开发者_Python百科ner friendly server controls when running in a designer such as SharePoint Desig

A web part can't use certain objects such as Page.Request as detailed in Best Practice to create desig开发者_Python百科ner 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?


We need the Toolpane.InCustomToolpane property

So from the toolpane code its

this.ParentToolPane.InCustomToolPane

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号