Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Re: Moving through the Session.Contents collection


Message #1 by tim.dick@s... on Tue, 14 Aug 2001 15:59:27
Your for each...next loop needs to become:

for (ObjItem in Session.Contents)
{
Response.Write ("Variable: '" + objItem + "' = " + Session.Contents
[objItem] + "<BR>)"
}

you might like to lose the end if as well.

Haven't tested this mind, but it seems to make sense.

Tim.

> 
> I have been able to understand and use all the VBScript code
> from the book,
> "Professional Active Server Pages 3.0" in projects but since
> it only
> contains VBScript examples I have had to translate all the
> VBScript code
> into JavaScript code. I haven't been able to translate this
> example and I
> need it the most from Chapter 3, pg 119 for the Session
> object (page
> session/show_session.asp). I cannot for the life of me
> convert this one to
> JavaScript. The code is below. I have not gotten any object
> to itinerate
> through it's collection successfully including this one.
> 
> <P><DIV CLASS="subhead">The Session.Contents
> Collection</DIV>
> 
> <%
> 
> For Each objItem in Session.Contents
> 
> Response.Write "Variable: '" & objItem & "' = " _
> 
> & Session.Contents(objItem) & "<BR>"
> 
> End If
> 
> Next
> 
> %>
> 
> 

  Return to Index