This documentation is archived and is not being maintained.

CatalogZoneBase::CatalogParts Property

Gets a collection of all the CatalogPart controls contained in a CatalogZoneBase zone.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

[BrowsableAttribute(false)]
public:
property CatalogPartCollection^ CatalogParts {
	CatalogPartCollection^ get ();
}

Property Value

Type: System.Web.UI.WebControls.WebParts::CatalogPartCollection
A CatalogPartCollection that contains all the individual CatalogPart controls in a zone.

ExceptionCondition
InvalidOperationException

A CatalogPart being added to the collection did not have a value assigned to its ID property.

The CatalogParts property provides a reference to a collection of all the CatalogPart controls in the zone. It references both the CatalogPart controls provided with the Web Parts control set, and any custom CatalogPart controls that are added to the zone.

The collection is initially created when another method accesses the CatalogParts property, and the property calls the CreateCatalogParts method.

NoteNote:

Note that any CatalogPart that is added to the collection of CatalogPart controls in an implementation of the CreateCatalogParts method must have a value assigned to its ID property, otherwise an exception will be thrown when the collection is assigned to the CatalogParts property.

The following code example demonstrates how to access the CatalogParts property programmatically. For the full code required to run the example, see the Example section of the CatalogZoneBase class overview.

The code example shows how to access the CatalogParts property, iterate through the collection, and list the IDs of all the CatalogPart controls in the zone.

No code example is currently available or this language may not be supported.

When you load the page in a browser, you can select Catalog from the drop-down list to switch to catalog display mode. When the catalog is visible, you can click the List CatalogParts button to demonstrate how the CatalogParts property can be accessed.

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.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: