how to print(output) all session variable

Discussion in 'ASP General' started by hon123456, Nov 17, 2005.

  1. hon123456

    hon123456 Guest

    Dear all,

    I am writing ASP page, and I have create many session
    variable. Is there exist a function or method to print out ( output )
    all the session variable in one page. Because I need to check the value
    of all session variable and I cannot scan all the asp page. So I want a
    function to print out all the session variable that I have created.
    Please help.

    Thanks.
     
    hon123456, Nov 17, 2005
    #1
    1. Advertising

  2. hon123456

    Evertjan. Guest

    hon123456 wrote on 17 nov 2005 in microsoft.public.inetserver.asp.general:

    > I am writing ASP page, and I have create many session
    > variable. Is there exist a function or method to print out ( output )
    > all the session variable in one page. Because I need to check the value
    > of all session variable and I cannot scan all the asp page. So I want a
    > function to print out all the session variable that I have created.
    > Please help.


    <p>Session Variables: </p>
    <% For each d in Session.Contents %>
    <%=d%> = <%=Session.Contents(d)%>
    <br>
    <% Next %>

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Nov 17, 2005
    #2
    1. Advertising

  3. hon123456 wrote:
    > Dear all,
    >
    > I am writing ASP page, and I have create many session
    > variable. Is there exist a function or method to print out ( output )
    > all the session variable in one page. Because I need to check the
    > value of all session variable and I cannot scan all the asp page. So
    > I want a function to print out all the session variable that I have
    > created. Please help.
    >
    > Thanks.


    Just use a for each...next loop. At its simplest:

    for each key in Session
    response.write key & ": " & Session("key") & "<BR>"
    next

    It gets a little more complicated if you are storing arrays or objects in
    session as you have to add checks for IsObject and IsArray into the loop and
    handle each accordingly.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows [MVP], Nov 17, 2005
    #3
  4. hon123456

    hon123456 Guest

    Thanks very much for your help
    Evertjan. 寫é“:

    > hon123456 wrote on 17 nov 2005 in microsoft.public.inetserver.asp.general:
    >
    > > I am writing ASP page, and I have create many session
    > > variable. Is there exist a function or method to print out ( output )
    > > all the session variable in one page. Because I need to check the value
    > > of all session variable and I cannot scan all the asp page. So I want a
    > > function to print out all the session variable that I have created.
    > > Please help.

    >
    > <p>Session Variables: </p>
    > <% For each d in Session.Contents %>
    > <%=d%> = <%=Session.Contents(d)%>
    > <br>
    > <% Next %>
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Replace all crosses with dots in my emailaddress)
     
    hon123456, Nov 17, 2005
    #4
  5. http://www.powerasp.com/content/new/displaying-session-and-application-variables.asp



    "hon123456" <> wrote in message
    news:...
    > Dear all,
    >
    > I am writing ASP page, and I have create many session
    > variable. Is there exist a function or method to print out ( output )
    > all the session variable in one page. Because I need to check the value
    > of all session variable and I cannot scan all the asp page. So I want a
    > function to print out all the session variable that I have created.
    > Please help.
    >
    > Thanks.
    >
     
    Kyle Peterson, Dec 4, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. keto
    Replies:
    0
    Views:
    1,045
  2. Lew
    Replies:
    0
    Views:
    650
  3. chowchho
    Replies:
    7
    Views:
    663
    Patrice
    Mar 28, 2008
  4. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    400
    David Cournapeau
    Dec 30, 2008
  5. Wolfgang
    Replies:
    1
    Views:
    167
    Paul Lalli
    Feb 13, 2004
Loading...

Share This Page