1
votes

I'm developing an ASP.NET WebForm application with .NET Framework 3.5 SP1 and C#.

I have a TreeView on a page. The user can navigate throught its nodes to select one. Then the user can edit the information represented by that node in another page. I want when the user come back to that page the treeview has selected the node that it was selected before.

UPDATE

The user select a node and then click on a asp.net button. Then the user goes to another page. On that other page, the user edit some data and then click on another asp.net button to come back to treeview.

I've tried to save selectednode on session but I need to load all treeview to find that node. It can take a lot of time to load all nodes.

Also, the treeview is loaded on TreeNodeExpanded event and I set its ExpandDepth property to 1. It doesn't have a datasource. I create and add nodes at runtime.

How can I do that?

If you need more details tell me!

Thank you.

2
Just clearify this to me, when the user clicks a node, it will move him to another page? right?...Madi D.
-sry..deleted 1st comment by mistake..- So , if trying to save the SelectedNode into session isnt optimum, because The treeview can be Huge?Madi D.
also is the Treeview being filled on PageLoad? or through binding some dataSource?Madi D.
I'm going to update the question with the answers of your questions.VansFannel

2 Answers

1
votes

Don't know if it's appropriate to your specific requirements, but generally the easiest way of dealing with these kinds of situations is to use a modal popup instead of sending the user to a completely different page.

0
votes

populate your tree nodes when the page loads first time. and if there is a selected node (in session, querystring, or cookie) select it while populating the tree.