CatalogPartCollection.Item Property (String)

Returns a member of the collection based on a unique string identifier.

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

public:
property CatalogPart^ default [String^] {
	CatalogPart^ get (String^ id);
}
/** @property */
public CatalogPart get_Item (String id)

Not applicable.

Parameters

id

The unique identifier for a particular CatalogPart in a collection.

Property Value

The first CatalogPart in the collection whose ID equals the value of id.

The Item indexer allows you to access the underlying CatalogPart controls in a CatalogPartCollection object by use of a string identifier. Although the CatalogPartCollection object is read-only, you can change the property values or call methods on the underlying controls accessed by the indexer.

The following code example demonstrates how you can access a member of a CatalogPartCollection object using its string ID value. 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. The method uses the Item indexer to retrieve information about the DeclarativeCatalogPart control, which is the second 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 DeclarativeCatalogPart control is obtained by using the Item indexer in the Button1_Click method.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: