Hi James,
TreeNode parameter in the e EventArgs is valid only when the event source is a TreeView, in the case of a ContextMenu from the TreeView, the event source is still the ContextMenu, not the TreeView, so you won't have that from the event args.
Also, the TreeView has built-in context menu support via ClientSideOnContextMenu property:
http://www.essentialobjects.com/Demo/Default.aspx?path=TreeView\_i1\_i9ClientSideOnContextMenu is a client side event, so you would give it a JavaScript function name. When user right click on a tree node, that function will be called and the node that was clicked will be passed to your handler. You can take a look of the source code of that sample to see how it works.
Since ClientSideOnContextMenu is on the client side, so if you need to pass the clicked node to the server side, you can pass it through a hidden field. For example:
Code: HTML/ASPX
<input type="hidden" id="rightClickedTreeNodePath" />
Code: JavaScript
function Your_ClientSideOnContextMenu_Handler(e, treeView, node)
{
var field = document.getElementById("rightClickedTreeNodePath");
//Save the clicked node's Path in rightClickedTreeNodePath.
//This value can later be retrieved by
//"Request.Form["rightClickedTreeNodePath"]" on the server
//side
field.value = node.getPath();
eo_ShowContextMenu(e, "ContextMenu1");
}
By the time you are inside ItemClick event for the context menu on the server side, you can use the following code to get the corresponding TreeNode:
Code: C#
//Get the node path
string path = Request.Form["rightClickedTreeNodePath"];
//Get the node from the path
EO.Web.TreeNode node = TreeView1.FindItem(path);
That should get you going. Please let us know if you need more help.
Thanks