Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Transfer data from one page to another in ASP

Posted on 2003-10-24
6
Medium Priority
?
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 6

Accepted Solution

by:
DoppyNL earned 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

705 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