Export (0) Print
Expand All

ImportCatalogPart Web Server Control Overview

The ImportCatalogPart Web server control imports a description file for a WebPart control.

This topic contains:

The ImportCatalogPart Web server control imports a description file for a WebPart control (or other ASP.NET server control that is used as a WebPart control). This enables the control to be added to a Web page with pre-assigned settings. The description file enables users to share settings for WebPart controls.

The description file is not the same as the control itself. It is an XML file that ends with a .WebPart file name extension and that contains name/value pairs that describe the state of the control. For information about the XML schema for the description file, see Web Parts Control Description Files. In addition to describing the control' state, the description file references the control name and the assembly (or file) that contains the control.

After a user imports a description file, the WebPart control referenced in the file appears in the ImportCatalogPart control, and a user can add the control to the page.

Associating Web Parts Controls with an ImportCatalogPart Web Server Control

A Web Parts control that is associated with a ImportCatalogPart control can be compiled into an assembly, or it can be a user control (.ascx file). In either case, the control referenced in an imported description file must exist on the Web server that contains the hosting page.

Users import a description file and its associated server control into a Web page by using the ImportCatalogPart control. This control must already be on the page. When a user switches the page to catalog display mode, the ImportCatalogPart control is displayed. Users can then browse to the control's .WebPart description file and import the control. The control's appearance and properties are specified in the imported description file.

Before they import a WebPart control description file, users must first create (export) the file based on an existing WebPart control. A description file can be exported for a control if the following conditions are met:

  • The control has properties marked with the Personalizable attribute.

  • The Web.config file has the enableExport attribute value set to true in the webParts element.

  • You have set the value of the control's ExportMode property to a value other than the default value of None, which prohibits export.

Enabling an ImportCatalogPart Web Server Control

The ImportCatalogPart Web server control is displayed at run time when a Web Parts page is in edit mode, and when the user has selected an associated WebPart control for editing. For more information, see Walkthrough: Changing Display Modes on a Web Parts Page.

For a code example that shows how to use the ImportCatalogPart Web server control, see the "Example" section of ImportCatalogPart.

Back to top

ImportCatalogPart

Provides the class definition of the ImportCatalogPart Web server control.

Back to top

Community Additions

ADD
Show:
© 2015 Microsoft