This documentation is archived and is not being maintained.

CatalogPartCollection::Item Property (Int32)

Gets or sets a member of the collection, based on its position in the collection.

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

public:
property CatalogPart^ Item[int index] {
	CatalogPart^ get (int index);
}

Parameters

index
Type: System::Int32
The index of a particular CatalogPart in the collection.

Property Value

Type: System.Web.UI.WebControls.WebParts::CatalogPart
A CatalogPart at the specified index in the collection.

The Item indexer allows you to access the underlying CatalogPart controls in a CatalogPartCollection object by index, and change their property values or call methods.

The following code example demonstrates how you can access a member of a CatalogPartCollection object using its index. For the full code required to run the example, see the Example section of the CatalogPartCollection class overview topic.

The code in the Button1_Click method creates a new CatalogPartCollection object named myParts. Note that the method uses the Item indexer to retrieve information from the first member of the collection.

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

When you load the page in a browser, you can switch the page into catalog mode by selecting Catalog in the Display Mode drop-down list control. Clicking the Display CatalogPart Properties button accesses the CatalogPartCollection object and displays certain properties of the contained CatalogPart controls. The count of available server controls within the PageCatalogPart control is obtained by using the Item indexer in the Button1_Click method.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: