Using Treeview for navigation between aspx pages ?

3 posts, 0 answers
  1. johan ekman
    johan ekman avatar
    2 posts
    Member since:
    Sep 2009

    Posted 28 Sep 2009 Link to this post

    Hello !
    In our project I am considering using your Treeview component in several places. (for different purposes) as I like the functionality it provides. However there is one issue I need input/help on.

    When using your Treeview in a Master/Content page context where the treeview component resides in the masterpage and navigates the user to different aspx pages (A very typical scenario IMO), you would loose the viewstate (because the page navigation is a GET not a POST) which would case the treeiview to loose its state each time I navigate in it. Obviously I want the treeview to keep its state between GET's (and not only postbacks which is easy enough).

    Any suggestions for solving this case ? I have seen that Gaiaware treeview can persist state in cookies, is there any similar functionality on this treeview component to keep client state between GETS ?

    I guess I could use page_load to find the node being loaded (finding the current node by comparing the navigation attribute of the page requested URL and then selecting it server side ?) but is this how it' supposed to be done.

    Thanks, Johan
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 28 Sep 2009 Link to this post

    I would check out the following sample given by a Telerik team member. I think this should take care of maintaining the state with your TreeView.
  3. johan ekman
    johan ekman avatar
    2 posts
    Member since:
    Sep 2009

    Posted 28 Sep 2009 Link to this post

    Thankyou this was excatly what I needed. I changed the example to only save the xml state on the nodeclickevent, this makes node collapsing and expanding much smoother (client side only) as I only need to save the state when a node is clicked (navigated) and not on expand/collapse.

    Works like a charm.
Back to Top