Asp.net|xml| Skills | questions
In an AJAX application, if the server side uses ASPX to return XML format data, it typically clears the VS-generated HTML character Fuxian, using Response.Write Output XML strings directly in the code file.
Note that the appropriate property client to set response can parse the string correctly.
To set the ContentType property first:
Response.ContentType = "Text/xml";
If the XML string contains Chinese, you also set the CharSet property:
Response.Charset = "GB2312";
Then output the content in the format of the XML file:
Response.Write ("<?xml version=\" 1.0\ "encoding=\" gb2312\ "?>");
Today is because of this charset let me depressed for a long time, because the XML character contains Chinese characters and did not set the charset, so xmlhttprequest.responsexml is always null, after half a day of information finally dawned.