HttpSessionState.StaticObjects プロパティ

定義

ASP.NET アプリケーションの Global.asax ファイルの <object Runat="Server" Scope="Session"/> タグで宣言されているオブジェクトのコレクションを取得します。

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

プロパティ値

HttpStaticObjectsCollection

Global.asax ファイルで宣言されたオブジェクトが格納されている HttpStaticObjectsCollection

次のコード例では、コレクション内の id オブジェクトの種類とオブジェクトの種類を StaticObjects 一覧表示します。

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

注釈

ページ上のオブジェクトがシリアル化をサポートせず、 Mode アウトプロセス (SQLServer または StateServer) の場合、オブジェクトは作成されず、このコレクションには追加されません。

このプロパティは StaticObjects 、以前のバージョンの ASP との互換性のために提供されています。

適用対象

こちらもご覧ください