Results 1 to 3 of 3

Thread: Viewstate

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Posts
    10

    Viewstate

    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?

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367
    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.

  3. #3
    Addicted Member
    Join Date
    Jan 1999
    Posts
    165
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width