网页上面都有一个 的标志?为什么这样呢?用来有什么用呢?怎么做呢?好,下面我们就简单的分析一下!站点用来和其他站点之间共享内容的简易方式(也叫聚合内容)。 RSS使用XML作为彼此共享内容的标准方式。用处就不多说了,大家关心的还是怎么做!
首先数据库设计,如图:
好,下面我们开始做页面,我使用的是Repeater控件,代码如下:ReadRss.aspx
<%@ Page language="c#" Codebehind="ReadRss.aspx.cs" AutoEventWireup="false" Inherits="MyTest.rss" ContentType="text/xml" %>
<asp:Repeater ))%></category>
</item>
</ItemTemplate>
<FooterTemplate>
</channel></rss>
</FooterTemplate>
</asp:Repeater>
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
BindData();
}
}
注意要用FormatForXml来格式化,否则输出不符合XML格式,会导致失败!