Solved

Transfer data from one page to another in ASP

Posted on 2003-10-24
6
291 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to dynamically set the form action using jQuery.

707 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

14 Experts available now in Live!

Get 1:1 Help Now