HttpApplicationState.Add(String, Object) Method

Definition

Adds a new object to the HttpApplicationState collection.

C#
public void Add(string name, object value);

Parameters

name
String

The name of the object to be added to the collection.

value
Object

The value of the object.

Examples

The following example adds two application variables named MyAppVar1 and MyAppVar2 to the Application collection.

C#
Application.Add("MyAppVar1", MyObject1);
Application.Add("MyAppVar2", MyObject2);

Applies to

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