CatalogZone.CreateCatalogParts Method

Definition

Creates an instance of each CatalogPart type that is declared in the zone.

protected:
 override System::Web::UI::WebControls::WebParts::CatalogPartCollection ^ CreateCatalogParts();
protected override System.Web.UI.WebControls.WebParts.CatalogPartCollection CreateCatalogParts ();
override this.CreateCatalogParts : unit -> System.Web.UI.WebControls.WebParts.CatalogPartCollection
Protected Overrides Function CreateCatalogParts () As CatalogPartCollection

Returns

A CatalogPartCollection with references to all the CatalogPart controls in the zone.

Exceptions

The current CatalogPart control does not have an ID.

Remarks

The CreateCatalogParts method is a critical method because when a user switches a page to catalog display mode, this method creates all the CatalogPart controls that make up the Web Parts catalog.

The CreateCatalogParts method in the CatalogZone class provided with the Web Parts control set can create any server control that inherits from the CatalogPart class. So, if you create a custom CatalogPart control and declare it on a page within a CatalogZone control, this method will create your control when a user switches the page to catalog mode.

However, for various reasons you might want control over the CreateCatalogParts method. You might want it to create only certain CatalogPart controls. For example, suppose you create a set of custom CatalogPart controls that have a consistent appearance and belong to a single product or organization. If you want page developers to be limited to using those custom controls in a catalog, then you should inherit from the CatalogZone class, override the CreateCatalogParts method, and allow the method to create only controls of the same type as your custom controls.

Applies to

See also