Link to home
Start Free TrialLog in
Avatar of shekhartgs
shekhartgs

asked on

Transfer data from one page to another in ASP

please help me!

May I please know the best way to pass (a lot of - for example hundreds of values) information from one asp page to another page. In this case my second page should just be a processing page - without any html content.

I came to know that using sessions is a bad practice for this situation.

thanks in advance.

...awaiting.
shekhar.
ASKER CERTIFIED SOLUTION
Avatar of DoppyNL
DoppyNL

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lozloz
lozloz

hi,

using a form with hidden values will work as well, you can use a link with some javascript to submit the form if you dont want a button (e.g. <a href="javascript:document.yourformname.submit();">)

loz
using a form with hidden values is indeed a possibility, but given the fact that there are hundreds of values involved doing it like that would result in bigger pages to transport to the user and slower overal performance of the involved pages.
DoppyNL -

You're correct about the reason not to use a form with hidden values.

I have to comment on your recommendation to use sessions instead of a database...

If this site is going to have a handful of users, then nothing wrong with your solution.  However if the site will have more than a few users than storing & retrieving vast amounts of session data is also going to slow down the process.  The slowdown will be on the server side instead of the transport but from a "user viewpoint" slow is slow.  Session variables were created for portability and convenient maintenance of session-state -- they're simply not optimized for heavy-duty data storage and retrieval.

shekhar, if you really have hundreds of fields then you're better off writing them to a database with some type of reference id and then just passing that reference id to the second page.
Another way would be to write the data to a text file, which uses the date and time as a file name, you can then read and delete the file on the next page. I would'nt know how this performs under load, maybe you could try. The other was is maybe to store the data in an array like a dictionary object and then store the dictionary object in a session variable and retriev the dictionary object on the the next page. Also I dont know how this would perform under load.
Avatar of David H.H.Lee
shekhartgs,
To solve your problems, you just need to use Server.Transer(). More details, please refer :
http://www.w3schools.com/asp/met_transfer.asp

Regards
x_com