還有 ContentType = "text/xml"; 這個最關鍵。
最後把 xml Save 輸出到 Response.OutputStream
OK
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
buildXmlDoc();
if (m_xDoc != null)
{
//Response.HeaderEncoding = System.Text.UTF8Encoding.UTF8;
Response.Charset = "utf-8";
Response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
Response.ContentType = "text/xml";
m_xDoc.Save(Response.OutputStream);
Response.Flush();
}
}
}
