我的树型结构是从数据库中加载出来的。
而我在加载的同时,我也程序选择了哪个节点被选中。
我现在的问题是:当一个节点处于选中状态的时候,怎么通过客户端教本来单击这个选中的节点。不知道我的意思说明白了吗!

解决方案 »

  1.   

    提供点思路:
    html:
    function Method1(a,b)
    {
      document.all.hidA.value = a;
      document.all.hidB.value = b;
      __doPostBack('LinkButton1','');
    }
    cs:
    1 在递归绑定tree时
    const string CLICK_TV_ITEM = "<a onclick=\"javascript:Method1({0},'{1}');\">{1}</a>";foreach(DataRow drSystem in dsCategory.Tables[0].Rows)
    {
    TreeNode node = new TreeNode();
    node.NodeData = drSystem["CategoryId"].ToString();
    node.Text = String.Format(CLICK_TV_ITEM,drSystem["a"],drSystem["b"]);
             ... 
    }2 在linkbutton click事件里 添加触发事件