protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e) { DeptInfos dept = new DeptInfos(); string deptid = this.TreeView1.SelectedNode.Value; string deptname = this.TreeView1.SelectedNode.Text; ltrHiddenDeptID.Text = deptid; int level = 0; if (Request["mode"].Equals("New")) { ltrTreePath_New.Text = dept.GetDeptpath(int.Parse(deptid), ref level); ltrHiddenLevel.Text = level.ToString(); } else if (Request["mode"].Equals("Rename")) { ltrTreePath_Rename.Text = dept.GetDeptpath(int.Parse(deptid), ref level).Replace(deptname, "").Replace("//", "/"); ltrHiddenLevel.Text = level.ToString(); txtDeptRename.Text = deptname; } else if (Request["mode"].Equals("Move")) { ltrTreePath_Move.Text = dept.GetDeptpath(int.Parse(deptid), ref level); ltrHiddenLevel.Text = level.ToString(); } else if (Request["mode"].Equals("Remove")) { //ltrTreePath_Remove.Text = dept.GetDeptpath(int.Parse(deptid), ref level); ltrTreePath_Remove.Text = WebCommon.GetParentTreeText(TreeView1); ltrHiddenLevel.Text = level.ToString(); } }
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e) { DeptInfos dept = new DeptInfos(); string deptid = this.TreeView1.SelectedNode.Value; string deptname = this.TreeView1.SelectedNode.Text; int level = 0; string script = "<script type='text/javascript'>\r\n" + "opener.document.getElementById('txtDeptMove').value='" + dept.GetDeptpath(int.Parse(deptid), ref level) + "';\r\n" + "opener.document.getElementById('txtMoveLevel').value='" + level.ToString() + "';\r\n" + "opener.document.getElementById('txtMoveDeptID').value='" + deptid + "';\r\n" + "self.close();\r\n" + "</script>\r\n"; Literal1.Text = script; }