TreeView Is Causing a Huge VIEWSTATE

Last post 07-22-2009 3:38 AM by Ickymacha. 6 replies.

Sort Posts:

  • TreeView Is Causing a Huge VIEWSTATE

    05-21-2003, 2:40 PM
    • Participant
      1,530 point Participant
    • MLibby
    • Member since 06-21-2002, 2:40 PM
    • Virginia
    • Posts 306
    Alright now, I'm concerned...

    With every node I add to the TreeView it appears that the VIEWSTATE expodentially increases. My tree is small but the size of the VIEWSTATE already has me worried. The functionality of my TreeView requires VIEWSTATE but does anyone have ideas on how to minimize the size of the VIEWSTATE?

    Mike
    - Cache entire web sites at the client and server and keep cache current. Cache just got easier!
  • Re: TreeView Is Causing a Huge VIEWSTATE

    09-09-2003, 9:38 AM
    • Member
      5 point Member
    • tonyduckett
    • Member since 09-09-2003, 9:32 AM
    • Posts 1
    Mike

    Did you ever get to the bottom of this. I have a similar issue with a hige Viewstate that is bulking the page size dramamtically.


    Any help much appreciated

    Tony
  • Re: TreeView Is Causing a Huge VIEWSTATE

    09-09-2003, 12:21 PM
    • Member
      70 point Member
    • BurKaZoiD
    • Member since 07-13-2002, 2:49 PM
    • Posts 14
    you can't cache the treeview on the webserver, in lieu of using the viewstate?
  • Re: TreeView Is Causing a Huge VIEWSTATE

    09-09-2003, 5:05 PM
    • Member
      70 point Member
    • BurKaZoiD
    • Member since 07-13-2002, 2:49 PM
    • Posts 14
    From the WebControls documentation itself:

    "Each time an update is made to the UI of a TreeView control, for example, whenever a node is expanded or collapsed, additional data is appended to the view state, which maintains a history of state changes in the Web page. This means that each time a view is updated with a large data island, the amount of data appended to the view state history is increased. In ASP.NET, there is a limit in the size of the view state, so the combination of very large tree hierarchies combined with multiple updates may cause performance problems, and in certain cases portions of the history could be lost."
  • Re: TreeView Is Causing a Huge VIEWSTATE

    09-09-2003, 5:06 PM
    • Member
      70 point Member
    • BurKaZoiD
    • Member since 07-13-2002, 2:49 PM
    • Posts 14
    From the webcontrols reference itself:

    "Each time an update is made to the UI of a TreeView control, for example, whenever a node is expanded or collapsed, additional data is appended to the view state, which maintains a history of state changes in the Web page. This means that each time a view is updated with a large data island, the amount of data appended to the view state history is increased. In ASP.NET, there is a limit in the size of the view state, so the combination of very large tree hierarchies combined with multiple updates may cause performance problems, and in certain cases portions of the history could be lost."
  • Re: TreeView Is Causing a Huge VIEWSTATE

    09-10-2003, 12:30 PM
    • Participant
      1,530 point Participant
    • MLibby
    • Member since 06-21-2002, 2:40 PM
    • Virginia
    • Posts 306
    No, I haven't and its still a concern. I've been thinking about turning the viewstate off for the tree control and repopulating it at every page request. I haven't tried this yet but in theory it should work. It may be more programming overhead to remember what selection the user made but this can be done in a script and then sending it to the server on post back. Some of our data in the trees is so large that I only want to send a portion to the user at a time anyway.

    The following is an example an client script that can retrieve a users selection on the tree
    http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=197977

    Please let me know how this works out for you and any recommendations you come up with.

    Regards,
    Mike
    - Cache entire web sites at the client and server and keep cache current. Cache just got easier!
  • Re: TreeView Is Causing a Huge VIEWSTATE

    07-22-2009, 3:38 AM
    • Member
      3 point Member
    • Ickymacha
    • Member since 07-22-2009, 3:27 AM
    • Posts 3

    Sorry to write in an old post, but I have this problem and I don´t know how to fix it, I´ve tried everything, chaging viewstate, put the tree in Session, but nothing work.


    If someone had made it work please let me know. Regards

Page 1 of 1 (7 items)