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:
What I have is a treeview menu in a "MenuCell" of a single, two cell, table in website masterpage that contains menu items that either show childnodes (sub-menu items) or directly display content.

All of my efforts have employed the TreeView.OnSelectedNodeChanged event.

When I click on a menu items with childnodes, I want the treeview to update (show the sub-menu items) and do so by calling a 'HomePage' which displays an image. And, when I click on a menu item w/o childnodes, I simply want that page's data to fill the "ContentCell" on right side of the display.

This works partially, at first, when I call a menu item that has childnodes and then an item w/o child nodes. But whenever I call a menu item w/o childnodes and then an item with child nodes either one of 2 things happens based on the code I employ.
1) If the code first calls the home page and then tries to "expand" the menu items for the selected menu item with childnodes, the home page with the image is shown but the submenu items are not shown.
2) If I do not call the homepage at all, but simply expand the menu for the menu item with child nodes, the child nodes are properly displayed, but the content from the prior menu item, without childnodes, remains.

Nothing pertinent happens in the HomePage other than loading the image.

My whole issue would be solved if I could programmatically 'expand' the sub menu items, but the TreeNode.Expand" Method refuses to do anything; after I've called the Home Page and even after storing the relevant TreeNode before calling the "HomePage" and Re-Selecting that TreeNode.

Suggestions Please!

What I have tried:

I've tried each of the page redirect/transfer methods.
Response.Redirect
Server.Transfer
Server.Execute

I've also tried writing my own "Expand" method. Mine simply cycled through each of the submenu items and attempted to 'Expand' these individually.

I've tried 'collapsing' the treenode submenu items first (even though they are not expanded at that point) and then trying to 'expand' them (out of sheer frustration).

What am I doing wrong? Why does the 'Expand' method work in one instance and not the other? I've been at this for hours and this is my second go it!

I'd put in a code example, but it all runs... it just doesn't do what I need it to do.

Thanks in advance for any help or suggestions!!
Posted
Updated 10-May-21 23:26pm
v4
Comments
[no name] 12-May-21 3:47am    
Sounds like you're not initializing properly for each "go around", and getting side effects from the previous go around (since this is supposed to be "stateless")

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