Solved

Transfer data from one page to another in ASP

Posted on 2003-10-24
6
293 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

813 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