Sharepoint - Get a list of the webparts on a page

You can add ?contents=1 to the current page url to view a 'web parts maintenance page'. From there you should be able to see the web parts on the page, the type, and if they're open or closed.


When using the SharePoint object model you can get a webpartcollection using the webpartmanager. This has a "WebParts" property which returns a webpartcollection. Here you can get all the webparts properties.

See: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpartmanager.aspx

Tags: