将XML呈现为所有浏览器的RSS源文本

时间:2014-01-28 00:31:43

标签: xml rss

XML呈现为文本而不是格式化的RSS。站点部署在IIS7(Windows Server 2012)上。示例代码如下:

<?xml version='1.0' encoding='utf-8'?>
<rss version='2.0'>
<channel>
<title>Site Title</title>
<link>http://iep036s:3648/Pages/TTV.aspx</link>
<description>RSS feed for the Video list.</description>
<lastBuildDate>Sat, 25 Jan 2014 20:31:01 GMT</lastBuildDate>
<generator>Description</generator>

<item>
<title >Title</title>
<link>http://iep036s:3648/Pages/Detail.aspx?Id=262</link>
<description>Description</description>
<pubDate>Wed, 16 May 2012 00:00:00 GMT</pubDate>
<guid isPermaLink='true'>http://iep036s:3648/Pages/Detail.aspx?Id=261</guid>
</item>
</channel>
</rss>

1 个答案:

答案 0 :(得分:0)

确保使用正确的Content-Type标题从IIS服务器提供:application/rss+xml