Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,
i am working on asp.net web application , where i need to save the state of the treeview i.e if user expands treeview nodes, it should remain expanded when clicked.
How to maintain such state across master pages in different folders?
e.g
-Home
   - Chapter1
       Section1
       Section2
   + Chapter2
+Features
+Articles
 
When I clicked on Section1 Link,the Treeview should remain open with same State
and should not get closed like fig below

-Home
   + Chapter1
   + Chapter2
+Features
+Articles
Posted
Comments
Sinisa Hajnal 28-Jan-15 6:01am    
It shouldn't close. You're probably re-loading it on postback.

Please check that you do NOT load the tree again when you do a postback. If you have to for some reason, then you have to remember last open or clicked node and select it manually, but if there is no reason to reload then don't.

1 solution

treeview loads automatically on postback(when new page loads) .
By default it looses its state
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900