如何编程更改treeview控件节点的url?如何在web.sitemap中插入一个节点值!!!! 1、我的treeview控件是从web.sitemap中读取树结构的,但我想根据操作动态更改一些节点的url,该如何实现?请高手帮忙!!!!2、如何编程才能在web.sitemap插入一个节点值? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 web.sitemap ?动态操作呀?下面是web.config里的实现 你参考下: public void ModifyConfig(string XPath,string key, string strValue) //修改配置 { #region 配置Web.Config文件 XmlDocument doc = new XmlDocument(); string Path = Request.PhysicalApplicationPath + "web.config"; //doc.Load(Server.MapPath("web.config")); doc.Load(Path); XmlNode addKey = doc.SelectSingleNode((XPath.Replace("?", key))); if (addKey == null) { //throw new ArgumentException("没有找到<add key='"+key+"' value=.../>的配置节"); Common.JS("没有找到<add key='" + key + "' value=.../>的配置节"); return; } addKey.Attributes["value"].InnerText = strValue; doc.Save(Path); #endregion } c#.net 使用MVC框架 求高手帮忙.谢谢 treeview中在节点设置NavigateUrl后,SelectedNodeStyle不起作用 怎么让光标在插入的文本后面??? url映射问题 请教个问题,呵呵:如何使DataGrid的某行满足某个条件时变色呢 为什么FrameWork1.1升级后有的程序运行不了? asp.net网站发布问题 高手帮帮忙啊~~~ 讀取excel單元格中的內容問題!在線給分啊! 关于客户端对话框的显示问题! 为什么我在页面加smartNavigation="true"之后页面的样式CSS全都没有了??? 最新作品 怎么协调DreamWeaver和VS?
public void ModifyConfig(string XPath,string key, string strValue) //修改配置
{
#region 配置Web.Config文件
XmlDocument doc = new XmlDocument();
string Path = Request.PhysicalApplicationPath + "web.config";
//doc.Load(Server.MapPath("web.config")); doc.Load(Path);
XmlNode addKey = doc.SelectSingleNode((XPath.Replace("?", key)));
if (addKey == null)
{
//throw new ArgumentException("没有找到<add key='"+key+"' value=.../>的配置节");
Common.JS("没有找到<add key='" + key + "' value=.../>的配置节");
return;
}
addKey.Attributes["value"].InnerText = strValue;
doc.Save(Path);
#endregion
}