我在后台添加了以下代码:
TreeNode fatherNode = new TreeNode();
fatherNode.Text = @"<table style='height:24px; broder:0px' cellspacing='0' cellpadding='0'><tr><td>
<img src='../../images/father_tree.gif' style='border:0px'/></td><td style='color:#ffffff ' onclick='changeBg(this);'> <b>角色管理</b></td></tr></table>";
fatherNode.Value = "角色管理";; TreeNode childNode1 = new TreeNode();
childNode1.Target = "mainwindow";
childNode1.Text = @"<table style='height:24px; broder:0px' cellspacing='0' cellpadding='0'><tr><td style='color:#ffffff ' onclick='changeBg(this);'> <b>增加角色</b></td></tr></table>";
childNode1.NavigateUrl = "../../file/roleManage/addRole.aspx";
childNode1.Value = "增加角色"; TreeNode childNode2 = new TreeNode();
childNode2.Target = "mainwindow";
childNode2.Text = @"<table style='height:24px; broder:0px' cellspacing='0' cellpadding='0'><tr><td style='color:#ffffff ' onclick='changeBg(this);'> <b>查看所有角色</b></td></tr></table>";
childNode1.NavigateUrl = "../../file/roleManage/lookAllRole.aspx";
childNode2.Value = "查看所有角色"; TreeNode childNode3 = new TreeNode();
childNode3.Target = "mainwindow";
childNode3.Text = @"<table style='height:24px; broder:0px' cellspacing='0' cellpadding='0'><tr><td style='color:#ffffff ' onclick='changeBg(this);'> <b>用户角色分配</b></td></tr></table>";
childNode1.NavigateUrl = "../../file/userManege/AssignRoles.aspx";
childNode3.Value = "用户角色分配"; fatherNode.ChildNodes.Add(childNode1);
fatherNode.ChildNodes.Add(childNode2);
fatherNode.ChildNodes.Add(childNode3);
fatherNode.Expanded = true;
TreeView1.Nodes.Add(fatherNode);
TreeView1.ExpandDepth = 2;
运行的时候怎么出下面的错误:?
function TreeView_ToggleNode(data, index, node, lineType, children) {
if (!data) {
return;
}
var img = node.childNodes[0]; //在这里说缺少对象? var newExpandState;
try {
if (children.style.display == "none") {
children.style.display = "block";
newExpandState = "e";
if ((typeof(img) != "undefined") && (img != null)) {
if (lineType == "l") {
img.src = data.images[15];
}
else if (lineType == "t") {
img.src = data.images[12];
}
TreeNode fatherNode = new TreeNode();
fatherNode.Text = @"<table style='height:24px; broder:0px' cellspacing='0' cellpadding='0'><tr><td>
<img src='../../images/father_tree.gif' style='border:0px'/></td><td style='color:#ffffff ' onclick='changeBg(this);'> <b>角色管理</b></td></tr></table>";
fatherNode.Value = "角色管理";; TreeNode childNode1 = new TreeNode();
childNode1.Target = "mainwindow";
childNode1.Text = @"<table style='height:24px; broder:0px' cellspacing='0' cellpadding='0'><tr><td style='color:#ffffff ' onclick='changeBg(this);'> <b>增加角色</b></td></tr></table>";
childNode1.NavigateUrl = "../../file/roleManage/addRole.aspx";
childNode1.Value = "增加角色"; TreeNode childNode2 = new TreeNode();
childNode2.Target = "mainwindow";
childNode2.Text = @"<table style='height:24px; broder:0px' cellspacing='0' cellpadding='0'><tr><td style='color:#ffffff ' onclick='changeBg(this);'> <b>查看所有角色</b></td></tr></table>";
childNode1.NavigateUrl = "../../file/roleManage/lookAllRole.aspx";
childNode2.Value = "查看所有角色"; TreeNode childNode3 = new TreeNode();
childNode3.Target = "mainwindow";
childNode3.Text = @"<table style='height:24px; broder:0px' cellspacing='0' cellpadding='0'><tr><td style='color:#ffffff ' onclick='changeBg(this);'> <b>用户角色分配</b></td></tr></table>";
childNode1.NavigateUrl = "../../file/userManege/AssignRoles.aspx";
childNode3.Value = "用户角色分配"; fatherNode.ChildNodes.Add(childNode1);
fatherNode.ChildNodes.Add(childNode2);
fatherNode.ChildNodes.Add(childNode3);
fatherNode.Expanded = true;
TreeView1.Nodes.Add(fatherNode);
TreeView1.ExpandDepth = 2;
运行的时候怎么出下面的错误:?
function TreeView_ToggleNode(data, index, node, lineType, children) {
if (!data) {
return;
}
var img = node.childNodes[0]; //在这里说缺少对象? var newExpandState;
try {
if (children.style.display == "none") {
children.style.display = "block";
newExpandState = "e";
if ((typeof(img) != "undefined") && (img != null)) {
if (lineType == "l") {
img.src = data.images[15];
}
else if (lineType == "t") {
img.src = data.images[12];
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货