次の方法で共有


Session StaticObjects コレクション

StaticObjects コレクションには、セッション オブジェクトのスコープ内で <OBJECT> タグを使用して作成されたすべてのオブジェクトが含まれます。StaticObjects コレクションを使用すると、オブジェクトの特定のプロパティの値を調べたり、コレクションに対して繰り返し処理を行って、すべてのオブジェクトのプロパティを取得したりすることができます。

構文

Session.StaticObjects( Key )

 

パラメータ
  • Key
    取得するプロパティです。
解説

ループ制御構造を使用すると、StaticObjects コレクションのすべての要素を対象として繰り返し処理を行うことができます。このスクリプト例を次に示します。

  <%
  Dim objProp
  For Each objProp in Session.StaticObjects
    If IsObject(Session.StaticObjects(objProp)) Then
      Response.write(objProp & " : Session object cannot be displayed."&_
      "<BR>")
    Else
    Response.write(objprop & " : " & Session.StaticObjects(objprop) &_
    "<BR>")
    End if
  Next
%>