js装载xml文件然后发向服务器,具体的代码可以参考下面的思路。
Ajax
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
public partial class testXml_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Request.InputStream);//接收到客户端传来的xml
xmldoc.Save(Server.MapPath("~"+"/hello.xml"));
Response.Write(xmldoc.InnerXml);//返回修改后的Xml文档
Response.End();
}
}
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
public partial class testXml_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(Request.InputStream);//接收到客户端传来的xml
xmldoc.Save(Server.MapPath("~"+"/hello.xml"));
Response.Write(xmldoc.InnerXml);//返回修改后的Xml文档
Response.End();
}
}
Xml文档:
<?xml version="1.0" encoding="utf-8" ?>
以上就是js装载xml文件然后发向服务器的实现代码的详细内容,更多请关注易知道|edz.cc其它相关文章!