ajaxp 写XML的问题
[AjaxPro.AjaxMethod]
public void Insert_cb(string content)
{
XmlDocument doc = new XmlDocument();
XmlElement newinfo = doc.CreateElement( "info ");
XmlElement newcontent = doc.CreateElement( "content ");
newcontent.InnerText = content;
newinfo.AppendChild(newcontent);
doc.DocumentElement.AppendChild(newinfo);
XmlTextWriter tr = new XmlTextWriter( "../backmanage/fixinfo.xml ",null);
tr.Formatting = Formatting.Indented;
doc.WriteContentTo(tr);
tr.Close();
}
我设置了断点,运行到doc.Load( "../backmanage/fixinfo.xml ");
就直接跳出来了,没有运行下面的语句,是不是ajax不能写XML文件呀?
请高手帮忙解答
------解决方案--------------------doc.load()运行时跳出来那是因为你这个XML文件没有找到!
------解决方案--------------------doc.Load(Server.MapPath( "backmanage/ ")+ "fixinfo.xml ");