public void readxml()
{
lobtype = Convert.ToString(Session["ddlvalue"]);
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath(@"\Files\" + lobtype + ".xml"));
TreeNode treenode = (TreeNode)e.Node;
XmlNode xmlnode = (XmlNode)e.Node.DataItem;
if (xmlnode.NodeType == XmlNodeType.Element)
{
if (xmlnode.Attributes != null)
{
for (int i = 0; i < xmlnode.Attributes.Count; i++)
{
TreeNode childnode = new TreeNode(
"@" + xmlnode.Attributes[i].Name,
"@" + xmlnode.Attributes[i].Name);
treenode.ChildNodes.Add(childnode);
}
}
}
}
如何将节点分配给控制器中的treenode
?我在这里面临错误:
名称&#39;节点&#39;在当前的背景下不存在,并且&#39; e&#39;是不存在的