Exporting Web Parts
Users sometimes want to customize a web part and then reuse those changes on other pages. To do that from the browser, they make their changes, export the web part, and then import it on a new page.
To make a web part exportable, set the web part's ExportMode property as shown here:
// Constructor (hooks up event procedures)
public Properties4( )
{
// Allow non-sensitive properties to be exported.
this.ExportMode = WebPartExportMode.NonSensitiveData;
}The preceding code exports all properties not marked as sensitive in the Personalization attribute. Once the web part is marked as exportable, SharePoint adds an Export item to the web part's Edit menu, as shown in Figure 11-13.

Figure 11-13. Exporting a custom web part
Within the web part page, the properties are serialized, as shown here:
<WpNs0:Properties4 runat="server" ID="g_ca01d903_5f15_49b9_8553_3942dadb87d5"
ExportMode="NonSensitiveData" Title="Properties4 Web Part"
CalDate="04/25/2007 12:19:01" ImportErrorMessage="Cannot import
Properties4 Web Part." _ _MarkupType="vsattributemarkup" _
_WebPartId="{CA01D903-5F15-49B9-8553-3942DADB87D5}" WebPart="true"
_ _designer:IsClosed="false" partorder="2"></WpNs0:Properties4>The ExportMode property sets the default mode used for the web part. You can override that setting by changing it in the web part tag above. The tag prefix used on the web part page is generated automatically. ...