http://localhost:2453/WebForm1.aspx?) %>]]></link>
<description><![CDATA[<%#Eval("Descript") %>]]></description>
<pubDate><![CDATA[<%#Eval("PubDate") %>]]></pubDate>
</item>
</ItemTemplate>
</asp:Repeater>
</channel>
</rss>
aspx.cs文件
namespace WebApp1
{
public partial class RSSDemo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
///一般这里会从数据库中查询数据,这里为了方便阅读就将就着用了
List<BookS> listBook = new List<BookS>() {
new BookS(){Title="ASP.NET",Descript="详解",,PubDate=DateTime.Now.AddMonths(1)},
new BookS(){Title="SqlServer",Descript="详解",,PubDate=DateTime.Now.AddMonths(-2)},
new BookS(){Title="Oracle",Descript="详解",,PubDate=DateTime.Now.AddDays(-11)},
new BookS(){Title="Ajax",Descript="详解",,PubDate=DateTime.Now.AddDays(10)},
new BookS(){Title="SilverLight",Descript="详解",,PubDate=DateTime.Now},
};
RepeatRSS.DataSource = listBook;
RepeatRSS.DataBind();
}
}
///实体类
public class BookS
{
public string Title { set; get; }
public string Descript{ set; get; }
public string ID { set; get; }
public DateTime PubDate { set; get; }
}
}