MS IE Treeview Problem
-
Hi, I loaded a Microsoft.Web.UI.WebControl Treeview in my ASP.Net page programmatically from a dataset. The treeview is in a form of a parent and child thing where the child is click and the page will then redirect to another page. The problem is, after loading the treeview, and after click one of the child to redirect to the next page, and when the new next page loads, the treeview seem to have collapse to its original form... How do I maintained the expanded treeview if I were to travel from page to page...? ~MicSky~
-
Hi, I loaded a Microsoft.Web.UI.WebControl Treeview in my ASP.Net page programmatically from a dataset. The treeview is in a form of a parent and child thing where the child is click and the page will then redirect to another page. The problem is, after loading the treeview, and after click one of the child to redirect to the next page, and when the new next page loads, the treeview seem to have collapse to its original form... How do I maintained the expanded treeview if I were to travel from page to page...? ~MicSky~
MicSky, The TreeView has no wait of remembering its state between pages. To get around this, I would add a parameter to the URL in your redirect called something like "nodeID". Then, pass a value that you can later use to identify which node the user clicked on. Then, write a function in your pages' base class (or elsewhere) that can open the TreeView to a particular node based on that value. Then, when the user clicks on the page, instead of redirecting them to "MyPage.aspx", the redirection will be "MyPage.aspx?nodeID=4". When MyPage.aspx loads, it will get the "nodeID" and open the TreeView to Node 4. There are other ways to do it, but this way is probably the most efficient because you never need to use the Session object. Chris