PersonalizationStateInfoCollection.Item[] Property

Definition

Gets an element from the collection based on the specified parameters.

Overloads

Item[Int32]

Gets a PersonalizationStateInfo instance located at the specified ordinal index in the collection.

Item[String, String]

Gets an element from the collection based on the specified parameters.

Item[Int32]

Gets a PersonalizationStateInfo instance located at the specified ordinal index in the collection.

C#
public System.Web.UI.WebControls.WebParts.PersonalizationStateInfo this[int index] { get; }

Parameters

index
Int32

The ordinal index of the object to be retrieved.

Property Value

A PersonalizationStateInfo instance located at the specified ordinal index in the collection.

Exceptions

index is less than zero.

-or-

index is greater than Count.

Remarks

This property retrieves the PersonalizationStateInfo instance located at the specified ordinal index in the collection.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Item[String, String]

Gets an element from the collection based on the specified parameters.

C#
public System.Web.UI.WebControls.WebParts.PersonalizationStateInfo this[string path, string username] { get; }

Parameters

path
String

The relative application path of the personalization state object to be retrieved.

username
String

The user name of the UserPersonalizationStateInfo object to be retrieved.

Property Value

An element from the collection based on the specified parameters.

Exceptions

path is null.

Remarks

This property is the default indexer for the collection. If only path is provided, the property returns a SharedPersonalizationStateInfo instance. If both path and username are provided, the property returns a UserPersonalizationStateInfo instance for the combination of path and username.

If path (in the case that username is set to null) does not exist, or if username and path do not exist, null is returned.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1