RSS

前台:

  


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RSS.aspx.cs" Inherits="RSS" ContentType="text/xml" %>



XXX网站书店

http://www.bookshop.com
zh-cn

5




<%#Eval("Title") %>
<%#Eval("Id","http://localhost:8088/BookDetail.aspx?id={0}") %>
<%#Eval("PublishDate") %>
XXX网站书店
<%#Eval("Author") %>
]]>





 

 

后台:

public partial class RSS : System.Web.UI.Page
{
  protected void Page_Load(object sender, EventArgs e)
  {
    LoadRssData();
  }

  private void LoadRssData()
  {
    List lst = new List();
    for (int i = 0; i < 15; i++)
    {
       lst.Add(new Books() { Id=i+1, Title="标题"+(i+1), Author="秋月光璇", ContentDescription="详细内容:"+Guid.NewGuid().ToString(), PublishDate=DateTime.Now});
    }
    this.RepeaterRss.DataSource = lst;
    this.RepeaterRss.DataBind();
  }

}

 

 

public class Books
{
  public Books()
  { }

  public int Id { get; set; }
  public string Title { get; set; }
  public string Author { get; set; }
  public DateTime PublishDate { get; set; }
  public string ContentDescription { get; set; }
}

 

转载于:https://www.cnblogs.com/qiuyueguangxuan/p/4106661.html

你可能感兴趣的:(ui,c#)