Search code examples
sharepointweb-partswebpartpage

Save web part configuration for a certain web part page


How can I save the configuration of a web part for a certain web part page in SharePoint?


Solution

  • From the UI you can export the web part. Edit the page, click the drop-down on the web part, and select Export. This allows you to save the web part's XML configuration so it can be uploaded elsewhere.

    You can also programmatically export the web part using the SPLimitedWebPartManager.ExportWebPart() method.

    For those web parts that do not allow an export, enumerate the web part properties programmatically. Here is a complete list of all web part members.