欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

js操作Xml(向服务器发送Xml,处理服务器返回的Xml)(IE下有效)_javascript技巧

程序员文章站 2022-04-11 11:14:12
...
前台:
复制代码 代码如下:




js操作Xml(向服务器发送Xml,处理服务器返回的Xml)(IE下有效)







Ajax Server:
复制代码 代码如下:

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
XmlNode rootnode = xmldoc.DocumentElement;
XmlNode pwd = rootnode.SelectSingleNode("pwd");
pwd.InnerText = "changed";//服务器端改变xml文档内容

Response.Write(xmldoc.InnerXml);//返回修改后的Xml文档
Response.End();
}
}

相关标签: js Xml