By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,496 Members | 1,527 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,496 IT Pros & Developers. It's quick & easy.

Best way to pass information between pages?

P: n/a
Hello all.

I want to know what would be the best way to pass information between
pages in ASP.NET? Querystring, seession variables, server transfer?
If possible if anyone can list advantages/disadvantages of each, or any
good/bad experience using one against the others.

Thanks

Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
hu*********@ge.com wrote:
Hello all.

I want to know what would be the best way to pass information between
pages in ASP.NET? Querystring, seession variables, server transfer?
If possible if anyone can list advantages/disadvantages of each, or any
good/bad experience using one against the others.

Thanks


MSDN has some good info:

http://msdn2.microsoft.com/library/z...us,vs.80).aspx

http://msdn2.microsoft.com/library/7...us,vs.80).aspx

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #2

P: n/a
Hi Craig,
Thanks for the information.
But the article doesn't mention server.transfer, for the obvious reason
that is not a way to maintain state, but it is a way to pass
information between pages. Do you or anyone else have any comments on
this?

Nov 19 '05 #3

P: n/a
I try to avoid Server.Transfer where possible. As far as I know using
request parameters (querystring) is more efficient (when you use
Server.Transfer ASP.NET will have to process the viewstate posted back
to the page you are transferring from).

The main argument I hear against using the querystring is that a user
can edit it, which is a potential security risk. I combat this by
including a one-way hash of the querystring as a parameter. If any
other part of the query string is changed without changing the hash
(which cannot be produced without a private key I store on the server)
I throw a SecurityException.

HTH,

-kb

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.