Gets or sets whether all, some, or none of a WebPart control's properties can be exported.
Assembly: System.Web (in System.Web.dll)
[<PersonalizableAttribute(PersonalizationScope.Shared)>] [<ThemeableAttribute(false)>] abstract ExportMode : WebPartExportMode with get, set [<PersonalizableAttribute(PersonalizationScope.Shared)>] [<ThemeableAttribute(false)>] override ExportMode : WebPartExportMode with get, set
Property ValueType: System.Web.UI.WebControls.WebParts.WebPartExportMode
One of the WebPartExportMode values. The default is None.
By default, a WebPart control cannot be exported and its property is set to None. To enable exporting all properties for the control, set the value to All. To export only certain properties while preventing the export of properties that contain sensitive data, you set the property value to NonSensitiveData.
To export property value descriptions for a WebPart control, the properties must also be marked with the Personalizable attribute in the metadata for the property's source code. For details, see PersonalizableAttribute.
To enable the export feature for a Web application that includes Web Parts controls, in the Web.config file for your application, you must add an attribute to the <webParts> element within the <system.web> section, as in the following markup.
The following code example demonstrates the use of the property. Note that for the export code example to work, you must also update your Web.config file by adding the attribute enableExport="true" to the <webParts> element, as indicated in the Remarks section.
The first part of this example contains the code for a control named TextDisplayWebPart. This control is the same as the custom control that is found in the Example section of the WebPart class overview, except that it adds a Personalizable attribute to the TextDisplayWebPart.ContentText property so the property can be exported. Note that the attribute declaration includes a value of true for the isSensitive parameter, meaning that the property is marked as sensitive data for export purposes. For the code example to run, you must compile this source code. You can compile it explicitly and put the resulting assembly in your Web site's Bin folder or the global assembly cache. Alternatively, you can put the source code in your site's App_Code folder, where it will be dynamically compiled at run time. This code example assumes that you compile the source code into an assembly, place it in a Bin subfolder of your Web application, and reference the assembly with a Register directive in your Web page. For a walkthrough that demonstrates both methods of compiling, see Walkthrough: Developing and Using a Custom Web Server Control.
The second part of the example shows how to reference the TextDisplayWebPart control in an ASP.NET Web page. Note that in the declarative markup, the property value is set to All, meaning that even properties with sensitive values will be exported.
Load the Web page in a browser, and on the verbs menu of the WebPart control, click the export verb and follow the instructions to export a description file containing the control's state and property data.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.