views:

13

answers:

1

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?

+1  A: 

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.

Ryan