Passing an array from one asp page to another?

Results 1 to 6 of 6

Thread: Passing an array from one asp page to another?

  1. #1
    Join Date
    Dec 1969
    Posts
    1

    Default Passing an array from one asp page to another?

    I need to send and array to a child window and I cannot use session variables. Can anyone help me?

  2. #2
    Join Date
    Dec 1969
    Posts
    973

    Default what does the array consist of... strings, digits

    .

  3. #3
    Join Date
    Dec 1969
    Posts
    96,118

    Default Where is the array now?

    Since you want to pass it to a child window, that implies to me that perhaps it already exists, as a JavaScript array, in the parent window.<BR><BR>If so, the child window could simply access it directly.<BR><BR>Example:<BR><BR>**** parent.html ****<BR><BR>&#060;SCRIPT&#062;<BR>var data = new Array( 17, &#039;John&#039;, 22, &#039;Harry&#039;, 97, &#039;Bill&#039; );<BR>...<BR>window.open( "child.html", "POPUP" )<BR>...<BR>&#060;/SCRIPT&#062;<BR><BR>******* child.html *******<BR><BR>&#060;SCRIPT&#062;<BR>var theArray = opener.data;<BR><BR>for ( i = 0; i &#060; theArray.length; i += 2 )<BR>{<BR> document.write( theArray[i+1] + " scored " + theArray[i] + "&#060;br/&#062;
    " );<BR>}<BR>...<BR>

  4. #4
    Join Date
    Dec 1969
    Posts
    7,686

    Default RE: Passing an array from one asp page to another?

    Use JOIN(theArray, "&#124") to get the array in a string<BR><BR>pass the string through the querystring or hidden form and use Split() on the child window.<BR><BR>Works only if the array isn&#039;t too big.


  5. #5
    Join Date
    Dec 1969
    Posts
    973

    Default RE: Passing an array from one asp page to another?

    if you can post to the child window, put the array in a hidden form field or URL.<BR><BR>If it isn&#039;t too big, put the elements in a string with each element delimited by some unique character or sequence of characters. You can do a split on your child page to retrieve the array from the string.<BR>You can sent it off as a URL with each element having its own parameter name... depends what you want to do.

  6. #6
    Join Date
    Dec 1969
    Posts
    96,118

    Default *ALL* these answers...

    ...are legitimate. But they all assume *DIFFERENT* things about what you are trying to do.<BR><BR>So if you don&#039;t tell us more, you won&#039;t necessarily get the right answer.<BR><BR>Again: WHERE is the array *now*?<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •