如何编程更改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 } ADO.NET里面有事务的功能?是不是我们应该放弃使用数据库的事务功能? 找不到工作了,我要创业! C# 怎么实现事务的开始,会滚和提交 转过了吗? ASP 页面怎么传值? 用DataGrid显示主次关系,也就是DataGrid嵌套,我看的例子都是在里面加<table>,如果是多列的话,<table>应该怎么加?谢谢。 运行这个存储过程出错,各位帮忙看下 高分求救,关于第三方控件的分页程序? 第一次在asp.net板块提问:如何获得DataGrid中动态控件的值 急求助,为何键盘第一次按键不响应!! 最新作品 怎么协调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
}