Here's the scoop...
Unlike the HTML server controls, for the Web server controls, you cannot simply use the HTML sytax to add cliend-side event handling. The reason is ASP.NET already uses client-side event handling code to perform automatic postback operations. So for Web controls you have to use Attributes.Add(...) to handle the client side click. Here are code snippets...
<HTML>
<HEAD>
<title>Main</title>
...
<script language="javascript">
<!--
function myFunction()
{
var newIndex= window.event.newTreeNodeIndex;
var Node = MyTree.getTreeNode(newIndex);
var NodeName = Node.getAttribute("text");
// I'm using an html text box here because I don't
// know how to set the web form text box in a client
// java script. Any help would be appreciated.
document.Main.htbSelected.value = NodeName;
}
//-->
</script>
</HEAD>
...
C# code:
private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
// I'm using one of many ways to populate the tree, an xml file.
MyTree.TreeNodeSrcFile = MapPath("EmpReportsTo.tns.xml");
MyTree.Attributes.Add("onselectedindexchange", "myFunction();");
DataBind();
}
}
...
That should be all you need. Let me know if this helps,
Mike

- Cache entire web sites at the client and server and keep cache current. Cache just got easier!