Do you actually need to postback treeview when selecting some node.
From my point of view, you can change contetx menu item text at client-side.
Using the OnContextMenuJavascript handler.
You can refer to default Demo_Office2003.aspx source code and specially the code:
function HandleContextMenuPopup(sender, node, event) {
var nodeContextMenuID = node.getContextMenuID();
if (node.getContextMenuID().length == 0) return;
var expandEnabled = node.getChildNodes().length > 0 && !node.getExpanded();
var collapseEnabled = node.getChildNodes().length > 0 && node.getExpanded();
var contextMenu = CFlyContextMenu.getInstanceById(\"\");
var items = contextMenu.getItems();
for(var i = 0; i < items.length; i++) {
switch(items[i].getCommandName()) {
case \"Expand\":
items[i].setDisabled(!expandEnabled);
break;
case \"Collapse\":
items[i].setDisabled(!collapseEnabled);
break;
}
}
}
Actually it just enables/disables some menu items.
But you can simply modify it in order to use
items[i].setText(\"Delete \" + node.getText());
Or something like this.