There are whole books on the subject.
I don't think anything I can say in a few lines is going to help!
Session is extremely useful and user specific. Requires lots of RAM.
Viewstate is also user specific - requires more traffic over the wire so it
is slower for the end user.
Querystring is great for passing small pieces of info in the URL like a PK
value.
Application is for all user but should be avoided in favor of Cache which is
the same thing but with more features.
(Application is more for backward compatibility.)
Cache can be set with priorities and expirations. You can also set
dependencies to expire it.
Very useful for application wide things that should be stored in RAM.
Server.Transfer is useful as stated in another message.
The main thing I don't like about it is that the URL does not change for the
user.
I also recently read that there may be a bug in it. Something about some
events not running correctly (or as anticipated) when using it. I tend to
stay away from it for these 2 reasons. YMMV.
--
Joe Fallon
"Ian" <ia*********@hotmail.com> wrote in message
news:eF**************@TK2MSFTNGP09.phx.gbl...
thanks joe,
great, any ideas which is the best route ?? you listed a few, are there
any pros and cons?
cheers
J
"Joe Fallon" <jf******@nospamtwcny.rr.com> wrote in message
news:eb**************@TK2MSFTNGP10.phx.gbl... In Page Load always test for IsPostback and Not IsPostback so that when the page is hit the first time different code is run.
If you click a button, then Page Load will run but maybe since
IsPOstback = True then you won;t do anything there.
Then your button handler code will run and you can do stuff.
The last line of code might be:
Response.Redirect("SomeOtherPage.aspx")
The variables will NOT be available on the next page unless you do
something.
Cache
Session
QueryString
etc.
e.g you could store them in Cache or Session during your button handler
code and then pull them out
when you get to the next page.
Or you could put them in a querystring:
Response.Redirect("SomeOtherPage.aspx?MyVariable=x yz")
--
Joe Fallon
"John W" <jw*****@hotmail.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl... Hello,
I have been wondering that everytime I do a submit on a button/form
(postback) it is using the same webform on the CS, how do I goto
another webform once I have done a postback and processed any code?
When I finally do goto another webform from the postback will all
variables and settings be sent along to this new web form?
Thanks
J