DeclarativeCatalogPart Web Server Control Overview

The DeclarativeCatalogPart control enables you to add a catalog of WebPart or other server controls to a Web page by using declarative syntax.

This topic contains:

The DeclarativeCatalogPart control enables you to add a catalog of WebPart or other server controls to a Web page. This lets users change the set of controls and the functionality available on a page at run time. A catalog is a list of WebPart or other server controls that is visible when a page is in catalog-display mode. At design time you can add controls to the DeclarativeCatalogPart control and at run time a user can choose which controls to view in the page by selecting them from the catalog list. For more information, see ASP.NET Web Parts Controls.

The DeclarativeCatalogPart control adds a new instance of a control to the Web page when a user selects a control from its catalog at run time. Users can add multiple instances of the same control in a catalog to a Web page.

Enabling a DeclarativeCatalogPart Web Server Control

You must put the DeclarativeCatalogPart control in a CatalogZoneBase zone, such as the CatalogZone zone. The DeclarativeCatalogPart control becomes visible only when a Web page is in catalog display mode.

For code examples that show how to use the CatalogZone control, see the "Example" section in CatalogZone Web Server Control Declarative Syntax and CatalogZone.

Creating an Application-wide Catalog of Controls

The DeclarativeCatalogPart control enables you to set up a catalog of controls that can be used throughout a site. Instead of declaring individual server controls in a DeclarativeCatalogPart control, you can set the WebPartsListUserControlPath property to the path of a user control that contains the list of server controls in the catalog. At run time, the server controls referenced in the user control are loaded into the catalog. This strategy enables multiple pages or sites to reference the same user control to create a catalog. When the list of server controls in the user control is updated, all catalogs based on the user control are updated.

For a code example that shows how to use the WebPartsListUserControlPath property, see the "Example" section in WebPartsListUserControlPath.

Back to top

DeclarativeCatalogPart

Provides the class definition of the DeclarativeCatalogPart Web server control.

Back to top

Community Additions

ADD
Show: