Results 1 to 7 of 7

Thread: [2005] Why can't I disable viewstate?

  1. #1

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    [2005] Why can't I disable viewstate?

    I have a page that contains a lot of data (client insists they don't want paging on this page) and the generated page contains between 4-5Mb of Viewstate data.

    I don't need to keep anything in viewstate and have set EnableViewState="false" at the page level, control level and temporarily on the MasterPage.

    Yet my page is still generating a 4Mb viewstate field, what can I do to stop this?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Why can't I disable viewstate?


  3. #3

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: [2005] Why can't I disable viewstate?

    Excellent.

    Isn't this a bit heavy handed though? I know if a method works it sometimes best to just go with it but part of me wants to just keep banging my head against the wall to figure out why something that should work doesn't.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Why can't I disable viewstate?

    The viewstate is there just in case you want to use features that use viewstate. The logic for it is, if you'r using ASP.NET, you will want to use one of its richer features at some point. Hence, the viewstate. Yes, it adds to the page size but it's something of a tradeoff since bandwidth is more 'available' now.

  5. #5

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: [2005] Why can't I disable viewstate?

    So enableViewstate=false is meaningless?

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [2005] Why can't I disable viewstate?

    Not necessarily, part of the viewstate that you cannot control through attributes like that is the control tree structure on the page, among other things which I am not fully aware of. But I did mention the control tree structure to appear smart to you. Impressed yet?

  7. #7

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: [2005] Why can't I disable viewstate?

    I'm always impressed.

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