ImportCatalogPart Web Server Control Overview
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.
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:
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.