Solved

Transfer data from one page to another in ASP

Posted on 2003-10-24
6
292 Views
Last Modified: 2010-04-06
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.
0
Comment
Question by:shekhartgs
6 Comments
 
LVL 6

Accepted Solution

by:
DoppyNL earned 500 total points
ID: 9613514
Because of the amount of data you've got 2 options:
- sessions
- database

Either case, you have to pass something via cookies or the url to know what data to retrieve on the next page.
So you are probably best of using sessions, as they are easy and more secure than a lot of people think.
If you do it with a database, you would in fact create your own version of sessions, why re-invent the wheel?

I don't know if there are any other solutions for this. Doubt it.
0
 
LVL 13

Expert Comment

by:lozloz
ID: 9613640
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
0
 
LVL 6

Expert Comment

by:DoppyNL
ID: 9613670
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.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 42

Expert Comment

by:frodoman
ID: 9613758
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.
0
 
LVL 2

Expert Comment

by:poopall
ID: 9613862
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.
0
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 9618757
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
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now