WebDataTree1.ClientEvents.SelectionChanging = "WebDataTree_SelectionChanging"
WebDataTree1.ClientEvents.SelectionChanging = "WebDataTree_SelectionChanging";
// The client event 'SelectionChanging' takes two parameters sender and e // sender is the object which is raising the event // e is the DataTreeSelectionEventArgs function WebDataTree_SelectionChanging(sender, e) { //Get the newly selected tree nodes array var newSelectedNodes = e.getNewSelectedNodes(); //Gets the text of the node at index 0 in the array var nodeText = newSelectedNodes[0].get_text(); if (!confirm("Are you sure you want to select the node '" + nodeText + "'?")) //Cancels the SelectionChanging event e.set_cancel(true); }