Pass values of your array from one page to another Header

Pass values of your array from one page to another

  [Call : 201-377-9031 (US) 0207-096-0627 (UK)]          About Us : Support : Contact  : Site Map 
    Home | Products | Hosting | Services | Resources | FAQ
HomePass values of your array from one page to anotherResourcesPass values of your array from one page to another
Home Products Hosting Services Resources FAQ
Resources

Pass values of your array from one page to another
Posted by : Amit Agarwal Total Hits : 33342

How often have you wanted to pass information in a array from one page to another ? I wanted to do it many times but used many things like session variables and application variables till I found the better way of doing it ! Using Split and Join Functions. Join() can put the values of your data in a array in a string seperated by a given charater. This data can then be put into a querystring and then be passed to the next page. You can now retrieve the values in the querystring and Split() them. Just use the function with the same character you has used to join them. And you have the data in a new array.


  
Get the Source Code.
Firstpage

Your Array


Dim myArray(3)
myArray(0) = "Item 1"
myArray(1) = "Item 2"
myArray(2) = "Item 3"
myArray(3) = "Item 4"

Now lets Join them using a comma. You can use any other character that you wish to use
data = join(myarray, ",")

Now lets send this data to another page
Response.redirect "nextpage.asp?data="&data

Nextpage

Now lets retrieve the data
newdata = request.querystring("data")

Lets Split them
newarray = split(newdata,",")

You can process the data in your array as you like.




 
Source Code






Countries where our products are used.


 Copyright © 2006 ScriptMate. Pass values of your array from one page to another 
Password Protection :: Church Membership Software :: Membership Management Software
Membership Software :: User Management :: Classified Ads Software :: FAQ Management Software :: Free VBScript Resource
Bunk Beds :: Cribs :: Cradles Kids Furniture :: New Born Baby Furniture :: Baby Furniture