PDA

Click to See Complete Forum and Search --> : Viewstate


SuperSly
Nov 1st, 2002, 02:33 PM
Can someone explain when I should leave viewstate enabled on controls and when should I disable it? Whenever I disable it , it seems to stop the form working properly. Can't I just leave them enabled ? how badly does it realy affect Performance?

Negative0
Nov 3rd, 2002, 09:19 PM
The viewstate stores the information in the controls between posts. When you do button clicks and the sort, it does a post back to the server and the viewstate is the way to maintain the information in the controls. As for performance, I am not sure how much it affects performance, so I cannot comment on that.

J Staniforth
Nov 7th, 2002, 09:15 AM
As was said viewstate holds info saying such things as whether a control is ticked by user between round trips to the server. In old ASP trying to maintain this kind of info as the user submits and moves from one page to another required some additional coding - but now its maintained for you. However, it does mean additional data are passed up and down the line between round trips and if you are trying to be efficient you may decide that sometimes you don't need to maintain this info for some controls (or you do it by other means) so you can disable this feature for those controls.