I have a treeview web control on a aspx frame page (menu.aspx). When the user clicks on a node on the treeview, the main frame (in the center of the page) navigates to the appropriate page. From this page (main.aspx) I need to know the selected node index from the control located on the menu page. How do I reference this control?
I may be going about this wrong ........so any insight would be helpful.
Originally I tried this...
Here is how the node is structured....
<asp:treenode name="product" navigateurl=".\\main.aspx"/>
SelectedNodeChanged event occurs....(when the user clicks a node in the treeview control)
Call class main.displaynodedata(myTree.nodes.selectedindex(selectednode).text) // syntax is probably wrong here...dont have the code in front of me.
When main.displaynodedata is called in main.cs it looks like this...
public void displaynodedata(string id)
txtName.text = id; // THIS LINE ERRORS OUT BECAUSE txtName DOES NOT EXIST YET BECAUSE THE PAGE HAS NOT LOADED.
When the node is clicked...it should navigate to the page (navigateurl) .....but my code executes first so the page hasnt load.
please help. :)