By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,796 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,796 IT Pros & Developers. It's quick & easy.

Retain treeview state during navigation

P: n/a
We are using a TreeView defined in a MasterPage for navigation.
The tree holds it's state turing postbacks just fine since it's using
viewstate. But whenever a node click results in a redirect to a new content
page the tree state is lost and the tree needs to be re-initialized.

Any tips on how to retain the state of the three also during non post-back
or requests (GET requests or Response.Redirect).

Some how I need to store the whole tree (nodes, states and all) to Session
or something similar. But I'm at loss on how.

--
Pl Andreassen
ne**@codroe.com
Mar 10 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
DWS
What does "turing navigation" mean?
What does tree Initialization mean?

Thanks
DWS
"Pål Andreassen" wrote:
We are using a TreeView defined in a MasterPage for navigation.
The tree holds it's state turing postbacks just fine since it's using
viewstate. But whenever a node click results in a redirect to a new content
page the tree state is lost and the tree needs to be re-initialized.

Any tips on how to retain the state of the three also during non post-back
or requests (GET requests or Response.Redirect).

Some how I need to store the whole tree (nodes, states and all) to Session
or something similar. But I'm at loss on how.

--
Pål Andreassen
ne**@codroe.com

Mar 10 '06 #2

P: n/a
I have just discovered this very same problem 2 hours ago.

The treeview works fine for browsing (expanding / contracting nodes) however
when transfer to a new page occurs the treeview is completely reset to its
original state.

I need it to maintain the users selection of expanded and contracted nodes.

Is this a bug with the treeview control ????
"Pål Andreassen" wrote:
We are using a TreeView defined in a MasterPage for navigation.
The tree holds it's state turing postbacks just fine since it's using
viewstate. But whenever a node click results in a redirect to a new content
page the tree state is lost and the tree needs to be re-initialized.

Any tips on how to retain the state of the three also during non post-back
or requests (GET requests or Response.Redirect).

Some how I need to store the whole tree (nodes, states and all) to Session
or something similar. But I'm at loss on how.

--
Pål Andreassen
ne**@codroe.com

Mar 10 '06 #3

P: n/a
=?Utf-8?B?RFdT?= <DW*@discussions.microsoft.com> wrote in
news:16**********************************@microsof t.com:
What does "turing navigation" mean?
What does tree Initialization mean?


Sorry, that should have been "during navigation".

As for tree initialization I mean the process of figuring out which nodes
should be in the tree. That is dependant on the logged-in users rights, the
context, what applications are installed and so on.

--
Pl Andreassen
ne**@codroe.com
Mar 13 '06 #4

P: n/a
=?Utf-8?B?ZGV3ZXlkb2c=?= <de******@discussions.microsoft.com> wrote in
news:E0**********************************@microsof t.com:
I have just discovered this very same problem 2 hours ago.

The treeview works fine for browsing (expanding / contracting nodes)
however when transfer to a new page occurs the treeview is completely
reset to its original state.

I need it to maintain the users selection of expanded and contracted
nodes.

Is this a bug with the treeview control ????


So, this is a consequence of how web controls store state in the VIEWSTATE
during postsbacks. When a navigation occurs (a redirect / normal GET
request) to a "new" page/URL there is no viewstate and hence the tree
looses it's state. Remember that webpages are essentially state-less. What
we are trying is to implement state accross multiple pages, and there
normally where Session (or querystrings) come to the rescue.

--
Pl Andreassen
ne**@codroe.com
Mar 13 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.