[thelist] Passing variables between aspx pages

David Travis dwork at macam.ac.il
Wed Aug 18 01:48:51 CDT 2004


Hi Jason,

I think that session variables are best solution of this case, it is a
server variable (not transferred to the client), and it exists between
requests, especially if all you want is to redirect from one page to another
and pass this piece of data with you.

If you prefer Server.Trasfer method there is one thing that can help you and
that's "Context.Handler", which you will call in page 2, and it will give
you a reference to the IHTTPHandler of the current request. This means that
you can get access to the page that redirected you to page 2. This way you
can query the original page for any property like the credit card number.

Note that this means you need to cast this reference to the proper class
(the code behind class of page 1), and in page 1 you need to declare the
public properties you want to expose (page1.CreditCard for example).

I hope I was clear...   :o)
David Travis.


-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Jason Robbins
Sent: Wednesday, August 18, 2004 2:25 AM
To: thelist at lists.evolt.org
Subject: [thelist] Passing variables between aspx pages

Hey all,

I have an aspx page that takes in a users credit card details, I then 
want to pass the user on to a confirmation page before processing the 
card. Using cookies, or query strings are out as i do not want to be 
passing credit card details back to the client even if it is over HTTPS.

The only thing I've found (but been confused by) is Server.Transfer, is 
this a suitable way? If so does anyone have any good links to explain 
it, MSDN description isn't all that good. Or does anyone know of another 
way?

Jas
-- 

News! - Evolt.org conference for web professionals. 
17-19 September 2004 in Toronto, Canada. 
Details at http://TOevolt.org

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 



More information about the thelist mailing list