Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Page Load
Message
 
To
22/05/2004 15:23:07
Keith Payne
Technical Marketing Solutions
Florida, United States
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00906068
Message ID:
00908380
Views:
19
>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
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform