Best way to pass information between pages?

  • Thread starter Thread starter hugo.flores
  • Start date Start date
H

hugo.flores

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top