loop though session

Discussion in 'ASP General' started by Aaron, Oct 27, 2003.

  1. Aaron

    Aaron Guest

    Is there a way I can loop through everything that is in session?
     
    Aaron, Oct 27, 2003
    #1
    1. Advertising

  2. Aaron

    Ray at Guest

    Dim ajs8ejfajshdfklhas734ur
    For Each ajs8ejfajshdfklhas734ur In Session.Contents
    Response.Write ajs8ejfajshdfklhas734ur & " = " &
    Session(ajs8ejfajshdfklhas734ur) & "<br>"
    Next

    Ray at work

    "Aaron" <> wrote in message
    news:...
    > Is there a way I can loop through everything that is in session?
    >
     
    Ray at, Oct 27, 2003
    #2
    1. Advertising

  3. Aaron

    Evertjan. Guest

    Aaron wrote on 27 okt 2003 in microsoft.public.inetserver.asp.general:

    > Is there a way I can loop through everything that is in session?


    <% For each d in Session.Contents %>
    <%=d%>
    =
    <%=Session.Contents(d)%>
    <br>
    <% Next %>


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Oct 27, 2003
    #3
  4. Aaron

    Aaron Guest

    thanks.

    Evertjan. wrote:
    > Aaron wrote on 27 okt 2003 in microsoft.public.inetserver.asp.general:
    >
    >
    >>Is there a way I can loop through everything that is in session?

    >
    >
    > <% For each d in Session.Contents %>
    > <%=d%>
    > =
    > <%=Session.Contents(d)%>
    > <br>
    > <% Next %>
    >
    >
     
    Aaron, Oct 27, 2003
    #4
  5. Aaron

    Aaron Guest

    just wondering ... why ajs8ejfajshdfklhas734ur ???? ;)

    Ray at <%=sLocation%> wrote:

    > Dim ajs8ejfajshdfklhas734ur
    > For Each ajs8ejfajshdfklhas734ur In Session.Contents
    > Response.Write ajs8ejfajshdfklhas734ur & " = " &
    > Session(ajs8ejfajshdfklhas734ur) & "<br>"
    > Next
    >
    > Ray at work
    >
    > "Aaron" <> wrote in message
    > news:...
    >
    >>Is there a way I can loop through everything that is in session?
    >>

    >
    >
    >
     
    Aaron, Oct 27, 2003
    #5
  6. Aaron

    Ray at Guest

    Ah, I'm just fed up with x, n, i, j, q, etc. ;]

    Ray at work

    "Aaron" <> wrote in message
    news:eDVA%...
    > just wondering ... why ajs8ejfajshdfklhas734ur ???? ;)
    >
    > Ray at <%=sLocation%> wrote:
    >
    > > Dim ajs8ejfajshdfklhas734ur
    > > For Each ajs8ejfajshdfklhas734ur In Session.Contents
    > > Response.Write ajs8ejfajshdfklhas734ur & " = " &
    > > Session(ajs8ejfajshdfklhas734ur) & "<br>"
    > > Next
    > >
    > > Ray at work
    > >
    > > "Aaron" <> wrote in message
    > > news:...
    > >
    > >>Is there a way I can loop through everything that is in session?
    > >>

    > >
    > >
    > >

    >
     
    Ray at, Oct 27, 2003
    #6
  7. Aaron

    Ray at Guest

    This isn't really an issue with IIS5 and higher.

    Ray at work

    "Peter Foti" <> wrote in message
    news:...
    >
    > Avoid this method, as it is unnecessarily inefficient. With the approach
    > above, the ASP interpretter will need to switch back and forth between

    HTML
    > and ASP. The other approaches posted don't.
    >
     
    Ray at, Oct 27, 2003
    #7
  8. Aaron

    Evertjan. Guest

    Peter Foti wrote on 27 okt 2003 in
    microsoft.public.inetserver.asp.general:

    > "Evertjan." <> wrote in message
    > news:Xns9421D93044C70eejj99@194.109.133.29...
    >> Aaron wrote on 27 okt 2003 in
    >> microsoft.public.inetserver.asp.general:
    >>
    >> > Is there a way I can loop through everything that is in session?

    >>
    >> <% For each d in Session.Contents %>
    >> <%=d%>
    >> =
    >> <%=Session.Contents(d)%>
    >> <br>
    >> <% Next %>

    >
    > Avoid this method, as it is unnecessarily inefficient. With the
    > approach above, the ASP interpretter will need to switch back and
    > forth between HTML and ASP. The other approaches posted don't.


    I agree it is inefficient in CPU time and before IIS 5. The searching for
    an unknown sesssionvariable name as such is terribly inefficient, as you
    should know that in your own environment. If you get an unknown session
    variable, how the hell would you know what to do with it, code wise?

    But it is very efficient educational wise,
    as, in my view, it is much easier to see the code flow
    than with response.write and lots of &&& and """.

    And as this code will probably only be used in an debugging environment,
    the cpu efficiency is rather or rather completely unimportant.


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
     
    Evertjan., Oct 27, 2003
    #8
  9. Aaron

    Jason Chan Guest

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> ¼¶¼g©ó¶l¥ó
    news:...
    > Dim ajs8ejfajshdfklhas734ur
    > For Each ajs8ejfajshdfklhas734ur In Session.Contents
    > Response.Write ajs8ejfajshdfklhas734ur & " = " &
    > Session(ajs8ejfajshdfklhas734ur) & "<br>"
    > Next
    >
    > Ray at work
    >
    > "Aaron" <> wrote in message
    > news:...
    > > Is there a way I can loop through everything that is in session?
    > >

    >
    >
     
    Jason Chan, Oct 28, 2003
    #9
  10. Aaron

    Harag Guest

    Ray could you explain why its not an issue with iis5+ or at least
    point us to some urls exaplaining why.

    I was looking at a site called "coveryourasp.com" which says that
    switching between asp & html is a bad thing and that he does his site
    all using response.write (or a cutdown version called "Out", example
    below)

    What you think to this sort of design for the site? please take a look
    at his and let me know your thoughts.

    Al.



    SUB out (sText)
    response.write sText
    END SUB

    Out "<html><title></title><body>"
    out "<table>"
    out "<tr><th>head1</th><th>head2</th></tr>
    out "<tr><td>1</td><td>2</td></tr>
    out "<tr><td>1</td><td>2</td></tr>
    out "<tr><td>1</td><td>2</td></tr>
    out "</table>"
    Out "</body></html>"

    etc

    On Mon, 27 Oct 2003 16:13:24 -0500, "Ray at <%=sLocation%>"
    <myfirstname at lane34 dot com> wrote:

    >This isn't really an issue with IIS5 and higher.
    >
    >Ray at work
    >
    >"Peter Foti" <> wrote in message
    >news:...
    >>
    >> Avoid this method, as it is unnecessarily inefficient. With the approach
    >> above, the ASP interpretter will need to switch back and forth between

    >HTML
    >> and ASP. The other approaches posted don't.
    >>

    >
     
    Harag, Oct 28, 2003
    #10
  11. Aaron

    Ray at Guest

    "Harag" <> wrote in message
    news:...
    >
    > Ray could you explain why its not an issue with iis5+ or at least
    > point us to some urls exaplaining why.
    >


    I don't have any links. This is just one of those things that I've heard
    enough times that I've chosen to believe it. I do believe that I've seen
    links about some differences betweeh IIS4 and 5 and why and how 5+ handles
    things differently.


    > I was looking at a site called "coveryourasp.com" which says that
    > switching between asp & html is a bad thing and that he does his site
    > all using response.write (or a cutdown version called "Out", example
    > below)
    >
    > What you think to this sort of design for the site? please take a look
    > at his and let me know your thoughts.
    >



    I like both ways. And I like to know [believe] that I can choose either way
    without it mattering. I use both ways depending on the situation. If I
    just need to response.write "<option>" & val & "</option>", I'll often
    response.write it. But if I'm throwing asp vars into what is mostly html, I
    will <%= %> it in the html.

    Ray at work
     
    Ray at, Oct 28, 2003
    #11
    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. Rodney Lane

    Local Authentication though web form

    Rodney Lane, Nov 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    312
    Rodney Lane
    Nov 12, 2003
  2. =?Utf-8?B?ZGh1cndpdHo=?=
    Replies:
    1
    Views:
    487
    Teemu Keiski
    Apr 10, 2004
  3. Joergen Bech
    Replies:
    2
    Views:
    3,318
    Joergen Bech
    Jul 2, 2005
  4. craig dicker
    Replies:
    9
    Views:
    705
    Juan T. Llibre
    Jul 7, 2005
  5. Isaac Won
    Replies:
    9
    Views:
    452
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page