HttpSessionState.StaticObjects Propriedade

Definição

Obtém uma coleção de objetos declarados por marcas <object Runat="Server" Scope="Session"/> dentro do arquivo de aplicativo Global.asax do ASP.NET.Gets a collection of objects declared by <object Runat="Server" Scope="Session"/> tags within the ASP.NET application file Global.asax.

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

Valor da propriedade

HttpStaticObjectsCollection

Um HttpStaticObjectsCollection objeto recipiente declarado no arquivo global. asax.An HttpStaticObjectsCollection containing objects declared in the Global.asax file.

Exemplos

O exemplo de código a seguir lista o id tipo de objeto e dos objetos na StaticObjects coleção.The following code example lists the id and object type of the objects in the 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

Comentários

Se um objeto em uma página não oferecer suporte à serialização e Mode estiver fora do processo ( SQLServer ou StateServer ), o objeto não será criado e não será adicionado a essa coleção.If an object on a page does not support serialization and Mode is out-of-process (SQLServer or StateServer), the object will not be created and will not be added to this collection.

A StaticObjects propriedade é fornecida para compatibilidade com versões anteriores do ASP.The StaticObjects property is provided for compatibility with earlier versions of ASP.

Aplica-se a