Restore treeview state when using materpages?

R

Robert Pettersson

Hi,

I have a app in c# where my pages are based on a masterpage. I have a
contentplaceholder to my left where I have my menu-treeview
and the rest is a contentplaceholder where I will load the data that was
selected in my treeview.

My problem is that when a item is selectd in my treeview the whole page
refreshes and the treeview collapses. That is beacuse the
treeview stores it state in viewstate, and since there is a postback when a
link is clicked, the state is removed.

I´m thinking of using frames instead. Beacuse then I can choose which frame
to reload, and keep the treeviewframe the same.
But I think that there should be a solution to this problem. I mean using
masterpages with a treeview as a menu seem to
be a good idea that MS should have thought about when developing it. But I
can´t find any examples or solutions on the net.

Can I use some kind of cache, can I choose which contentplaceholder to be
reloaded, or can I set some property that make the treeview store
it´s state in a session variable instead of viewstate? I thought about
trying to store the selected item in a session variable myself and the
set it when it reloads, but I could not get it to work.

If anyone can give me some examples, tips or suggestions on how to solve
this I would be very greatful! Or maybe I should just forget masterpages and
use frames instead?

Thanks,

Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top