public JsonResult ddllistvalue(string datafeedid)
{
Session["ddlvalue"] = datafeedid;
return Json(db.PopulateProgramddl(), JsonRequestBehavior.AllowGet);
}
public void readxml()
{
lobtype = Convert.ToString(Session["ddlvalue"]);
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath(@"\Files\" + lobtype + ".xml"));
TreeNode treenode = Node;
XmlNode xmlnode = 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);
}
}
}
}
使用razor.please从mvc4中的xml文件生成xml treeview。请将此问题保存起来。错误是:当前上下文中不存在名称“Node”。使用'node'来解决问题