views:

22

answers:

2

I have a web part that saves preferences to an external database because they are used by an outside program. One of the key fields for the preferences is the ID of the web part so each web part instance can have separate preferences.

I'm working on an issue in the test farm with a set of preferences that generate an error on the SharePoint page and I need to check the values of the preferences for that web part instance. I didn't expose the ID of the web part in the editor. So, now I can see the ID in the database but I don't know to which web part instance it belongs.

Is there a way to find the ID of a web part without having to modify the code to expose it and redeploy the solution?

A: 

You can probably open the web part page in SharePoint Designer and see it there

Vladi Gubler
+1  A: 

Get up the Toolpart (Modify Shared Web Part) then Right Click > View Source.

Do a search for

MSOSPWebPartManager_OldSelectedStorageKeyName

and there is the ID of your web part (Microsoft.SharePoint.WebPartPages.WebPart.ID)

Tested with WSS3 (SharePoint 2007) and SharePoint Foundation 2010.

Ryan
The id from the actual ID from the context of the webpart seems to be prefaced with "g_".
Kelly French