aspx页面生成xml数据

第一步:将aspx页面标签清空。只剩下page声明即可。如下图

第二步:准备xml格式数据,

第三步:在cs文件pageload方法里写

 if (!IsPostBack)
{

Response.ContentType = "text/xml";
Response.Charset = "utf-8";
Response.Write(str_xml);

}

第四步:浏览即可。

原文地址:https://www.cnblogs.com/liang-ling/p/3382716.html