Link to home
Start Free TrialLog in
Avatar of epmo
epmo

asked on

transfering data between pages

What is the best way to transfer data from a form to another page?

We're not doing a post to a second page b/c we are hadling the data insert to the DB from webform1.aspx.cs

but we want to display a confirmation page with the values submitted. What would be the best way to do it?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Yurich
Yurich
Flag of New Zealand image

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 epmo
epmo

ASKER

is session the best way to handle them? is the session object reliable?
well, i'd say it's reliable and a very good way to handle it, but probably you might want to hear somebody's else opinion ;)

regards
SOLUTION
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
to my understanding, there was a different way of passing individual variables between pages but can't recall it how to do it exactly - it was as passing parameters in the address of the page you're calling for... I don't remember syntax and this way was very fast but absolutely unsecure, so probably you wouldn't like to use it anyway...

the only other issue with session is it can take some memory on the server, so, if you have multi-user application and they all simultaneosly passing sessions between their pages, it can become resource-stressful... so delete it when you don't need it as stated above

regards,
yurich
ah you are talking about through the query string. Basically the way that works is you are tagging on variables at the end of the URL.
you access this with Request.QueryString["VariableName"] and it returns a string.
so you can build a link or url http://whereyouaregoing.com/index.aspx?whoami=jj&wherecanifindstuff=expertsexchange   (yes it is corny)

Request.QueryString["whoami"] == "jj"

and

Request.QueryString["wherecanifindstuff"] == "expertsexchange"

You will want to use the frameworks method for throwing things into the querystring so it can handle all of the special charachters for you.

But remember these need to be validated. These inputs can be malformed by a user.
Avatar of epmo

ASKER

hmm..   what about a form "POST"?  
what do you mean by "POST", posting back to the server?
Avatar of epmo

ASKER

no we mean, posting a form to a separate page..