Active Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 1763
Number of posts: 4498

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
JScript Session array problem Posted by 4deepakswallet on 22 Jul 2002 at 6:27 PM
How do i modify a Session array using JScript
For e.g., i want the Session("users") to store the names of 0 to 100 users at a given time. So

Session("users")=new Array()
for(i=0;i<n;i++)
Session("users")[i]=....

or

var us=new Array()
for(i=0;i<n;i++)
us[i]=...
Session("users")=us

Both give errors such as a session variable cannot be use with an intrinsic object etc.
Are there any errors here or do we have to include something for these to work properly.
I use PWS on my Win98 system.

I am desperate. Please do reply quickly.
Loads of thanks in advance.

Deepak
deepak-p@eth.net
Report
Re: JScript Session array problem Posted by sharath_kh on 23 Jul 2002 at 4:22 AM
If the session variable that u are setting as an array is used in the server side then it should be included in delimiters. Like -
U can use this code. Hope it would work for u.

arrusers=new Array()
for(i=0;i<n;i++) {
arrusers[i]=....
}

Then if this array is to be accessed from Server side ASP script then u have to include this code
<%Session("users")%>=arrusers

Report
Re: JScript Session array problem Posted by RadarBob on 19 Aug 2002 at 7:18 AM
Right. In other words, you must first create the array in JScript (in this case) then assign it to a session variable. Then to use the array you must first assign the session variable back into a JScript array.

: If the session variable that u are setting as an array is used in the server side then it should be included in delimiters. Like -
: U can use this code. Hope it would work for u.
:
: arrusers=new Array()
: for(i=0;i<n;i++) {
: arrusers[i]=....
: }
:
: Then if this array is to be accessed from Server side ASP script then u have to include this code
: <%Session("users")%>=arrusers
:
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.