private void doDelete(string Id) { XmlNode xmlNode = xmldoc.SelectSingleNode("//pagetemplate/item[@name=" + Id + "]"); xmlNode.ParentNode.RemoveChild(xmlNode); xmldoc.Save(Server.MapPath(_MainTemplatePath + "config/pagestyle.config")); JS.AlertDoFun("恭喜,分页样式删除成功!", "location.href='" + KSCMS.GetComeUrl() + "';"); }
protected void Foot2_Submit(object sender, EventArgs e) { string title = this.TxtTitle.Text; if (string.IsNullOrEmpty(title)) { JS.AlertDoFun("请输入分页名称!", "history.back()"); } else { //创建一个新节点 XmlElement newElement = xmldoc.CreateElement("item"); XmlNode root = xmldoc.SelectSingleNode("pagetemplate"); XmlNodeList xnl = root.ChildNodes; int maxid = 0; foreach (XmlNode xnf in xnl) { XmlElement xe = (XmlElement)xnf; int id = Utils.StrToInt(xe.GetAttribute("name")); if (id > maxid) { maxid = id; } } newElement.SetAttribute("name", (maxid + 1).ToString()); newElement.SetAttribute("issys", "0"); newElement.SetAttribute("title", title); //创建newElement下的节点 XmlElement etp = xmldoc.CreateElement("tp"); etp.InnerText = this.TxtTp.Text; //将newElement下的节点加到newElement上 newElement.AppendChild(etp); //将newElement加入到xml文件中(加在最后一条记录上) xmldoc.DocumentElement.AppendChild(newElement); xmldoc.Save(Server.MapPath(_MainTemplatePath + "config/pagestyle.config")); } JS.Confirm("恭喜,分页样式添加成功,继续添加吗?", "location.href='" + KSCMS.GetInstallDir() + MyCache.GetCacheConfig(4) + "/label/KS.Label.PageStyle.aspx?action=Add&templateId=" + templateId + "';", "location.href='" + KSCMS.GetInstallDir() + MyCache.GetCacheConfig(4) + "/label/KS.Label.PageStyle.Aspx?templateId=" + templateId + "';"); }
protected void Page_Load(object sender, EventArgs e) { url = "http://" + Request.Url.Authority; if (FileExists(HttpContext.Current.Server.MapPath(KSCMS.GetInstallDir() + "install/install.lock"))) { JS.AlertDoFun("安装程序已运行过了,如果要重新安装,请先删除install/install.lock文件!", "location.href='/';"); } else { if (KSCMS.S("action") == "install") { Response.Cache.SetCacheability(HttpCacheability.NoCache); //禁止缓存 beginInstall(); KSCMS.Die(); } else if (KSCMS.S("action") == "finish") { BtnStep3Next_Click(null, null); } } }