int records = 0;
StringBuilder sp = new StringBuilder("<?xml version=\"1.0\" encoding=\"utf-8\" ?><item>");
List<Article> AdList = ArticleInfo.getArticleInfoList(100, 2, "", 1, 5, out records);
sp.AppendFormat("<newis morelink=\"#\">");
foreach (Article ad in AdList)
{
sp.AppendFormat("<news links=\"{0}\" times=\"{1}\">\"{2}\"</news>","#","2010-8-10",ad.ArtName);
}
sp.AppendFormat("<\newis>");
sp.AppendFormat("<yewu>");
List<Product> plis=ProductInfo.getProductInfoList(1,"");
foreach(Product ad in plis)
{
sp.AppendFormat("<yew tit=\"{0}\" images=\"{1}\" links=\"{2}\">\"{3}\"</yew>", ad.ProName, "../UpLoad/" + ad.PicUrl1, "Products.aspx",
JScript.curStr(ad.Summary,100));
}
sp.AppendFormat("</yewu>");
sp.Append("</item>");
//XmlDocument xmldoc = new XmlDocument();
//xmldoc.LoadXml(
Response.ContentType = "text/xml";
Response.Charset = "utf-8";
Response.Write(sp.ToString());
Response.End();
无法显示 XML 页。 使用 XSL 样式表无法查看 XML 输入。请更正错误然后单击 刷新按钮,或以后重试。 -------------------------------------------------------------------------------- 该位置上不允许有空白。处理资源 'http://localhost:8028/Readxml.aspx' 时出错。第 1 行,位置: 267
"...
后台代码:
解决了可以关闭问题了。