1

hi i am using a treeview control in my page i am binding the treeview with the datatable

i need to use javascript to get the selected node value on the tree in a button click. how to do this

1
  • Can you show me your how u are populating treeview Control? Commented Jun 23, 2009 at 11:27

1 Answer 1

2

When you bind your tree, use the navigateURL property of each node to call a JavaScript function.

When you bind:

newNode.NavigateUrl = "javascript:clickNode(this, '" + someObject.ID.ToString() + "');

On the client:

var selectedNode;
var selectedValue;

function clickNode(sender, id)
{         

    selectedNode = sender;
    selectedValue = id;

    //do other stuff here       
}    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.