I need to know the selected node's parent node text from a ASP.NET Treeview on client side.
Is there anyway to know this?
Thank you!
Finally it is solved -
function GetSelectedNode() {
var treeViewData = window["<%=treeView.ClientID%>" + "_Data"];
if (treeViewData.selectedNodeID.value != "") {
var selectedNode = document.getElementById(treeViewData.selectedNodeID.value);
var ParentNode = selectedNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling.innerText;
}
return ParentNode;
}