CatalogZone::CreateCatalogParts Method
Creates an instance of each CatalogPart type that is declared in the zone.
Assembly: System.Web (in System.Web.dll)
Return Value
Type: System.Web.UI.WebControls.WebParts::CatalogPartCollectionA CatalogPartCollection with references to all the CatalogPart controls in the zone.
| Exception | Condition |
|---|---|
| InvalidOperationException | The current CatalogPart control does not have an ID. |
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.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.