HttpApplicationState.Item[] Property

Definition

Gets access to an object in an HttpApplicationState collection. This property is overloaded to allow access to an object by name or numerical index.

Overloads

Item[String]

Gets the value of a single HttpApplicationState object by name.

Item[Int32]

Gets a single HttpApplicationState object by index.

Item[String]

Gets the value of a single HttpApplicationState object by name.

C#
public object this[string name] { get; set; }

Parameters

name
String

The name of the object in the collection.

Property Value

The object referenced by name.

Examples

The following example returns an object named MyAppVar1 from the HttpApplicationState collection of the intrinsic Application object and copies it to a new object variable.

C#
Object MyObject;
MyObject = Application["MyAppVar1"];

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 1.1, 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[Int32]

Gets a single HttpApplicationState object by index.

C#
public object this[int index] { get; }

Parameters

index
Int32

The numerical index of the object in the collection.

Property Value

The object referenced by index.

Examples

The following example returns the first object (index = 0) from the HttpApplicationState collection of the intrinsic Application object and copies it to a new object variable.

C#
Object MyObject;
MyObject = Application[0];

Applies to

.NET Framework 4.8.1 i druge verzije
Proizvod Verzije
.NET Framework 1.1, 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