Shyju
Shyju

Reputation:

How to read XML sent using XMLHTTP in codebehind file?

I have a javascript code where i am creating an XML Dom and sending (using XMLHTTP ) it to a codebehind page (server.aspx.cs).How can i read the XML there ?

Upvotes: 1

Views: 695

Answers (1)

Tim C
Tim C

Reputation: 70638

One way to achieve this is to simply load the InputStream from the Request object into an XmlDocument object

protected void Page_Load(object sender, EventArgs e)
{
    XmlDocument postedXml;
    postedXml = new XmlDocument();
    postedXml.Load(Request.InputStream);

You can then access the postedXML document as normal.

Upvotes: 2

Related Questions