>Chris,
>
>Using viewstate sends all of the viewstate objects' data to the browser on each postback. Using sessionstate keeps the data on the server.
>
>This can have a large impact on speed.
It can but it depends. In general I like to avoid either session or viewstate to keep up performance, but it all depends on what's more efficient.
As a general rule I do what ASP.Net does internally which is basically that state persistent to the page or the UI goes into ViewState.
Furthermore there's a difference in how data carries. Viewstate is limited and automatically cleared on a per page basis, while session state carries acorss a user's session, which means there's additional management required to clean up the cookie each time.
FWIW, I turn off ViewState oin all of my pages and controls and only add it in one at a time as I need it. Using ViewState by default is definitely a no-no if you want to have performant ASP.Net applications.
+++ Rick ---
>>I wonder if it would be better to use ViewState in this situation. I am not sure, but I thought it was better to use Session when moving to a different page, and ViewState for postbacks. I am not really sure there is any difference.
>>
>>>Valentin,
>>>I set a session variable to tell me such things
>>>something like this...
>>>
>>>Private sub myRoutine()
>>> Session("CalledFrom_myRoutine")=True
>>> ...other code for this routine...
>>>endsub
>>>
>>>
>>>
>>>hth,
>>>Rick