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
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