I have a tree view where I need to alert the name of the selected node. However, my current code is only displaying the name of the initially selected node and not updating with subsequent selections.
For example, if I first select Node "A", it alerts "A". But then if I choose a different node, it still alerts me with "A".
Below is the code I am using:
function childnode(event) {
var treeViewData = window["<%=nav_tree_items.ClientID%>" + "_Data"];
var selectedNode = document.getElementById(treeViewData.selectedNodeID.value);
alert(selectedNode.nodeName.toString());
return false;
}
The treeview content is generated dynamically from a database.