1

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.

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

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.