HttpSessionState.StaticObjects Propriété

Définition

Obtient une collection d'objets déclarés par des balises <object Runat="Server" Scope="Session"/> dans le fichier Global.asax de l'application ASP.NET.

public:
 property System::Web::HttpStaticObjectsCollection ^ StaticObjects { System::Web::HttpStaticObjectsCollection ^ get(); };
public System.Web.HttpStaticObjectsCollection StaticObjects { get; }
member this.StaticObjects : System.Web.HttpStaticObjectsCollection
Public ReadOnly Property StaticObjects As HttpStaticObjectsCollection

Valeur de propriété

HttpStaticObjectsCollection

HttpStaticObjectsCollection contenant des objets déclarés dans le fichier Global.asax.

Exemples

L’exemple de code suivant répertorie le type d’objet et les id objets de la StaticObjects collection.

foreach (System.Collections.DictionaryEntry de in Session.StaticObjects)
  Response.Write(de.Key + " is of type " + de.Value.GetType().ToString() + "<br />");
For Each de As System.Collections.DictionaryEntry In Session.StaticObjects
  Response.Write(String.Format("{0} is of type {1}<br />", de.Key, de.Value.GetType()))
Next

Remarques

Si un objet sur une page ne prend pas en charge la sérialisation et Mode est hors processus (SQLServer ou StateServer), l’objet ne sera pas créé et ne sera pas ajouté à cette collection.

Le StaticObjects propriété est fournie pour la compatibilité avec les versions précédentes d’ASP.

S’applique à

Voir aussi