This article is about how to implement the repeater to display the separator, here is a good example, interested friends can refer to the following
Code as follows: protected void Page_Load (object sender, EventArgs e) { if (! Page.IsPostBack) { Rptlist.datasource = gettable (); rptlist.databind (); } } protected void Rptlist_itemdatabound (object sender, RepeaterItemEventArgs e) { if (E.item.itemtype = = ListItemType.AlternatingItem | | E.item.itemtype = = ListItemType.Item) { DataRowView DRV = (DataRowView) e.item.dataitem; Literal Ltltitle = (Literal) e.item.findcontrol ("Ltltitle"); Ltltitle.text = DRV. row["title"]. ToString (); if (e.item.itemindex + 1)% 5 = 0 && (e.item.itemindex + 1) <) { system.web. Ui. LiteralControl ul = new LiteralControl (" "); E.item.controls.add (UL); } ,} } DataTable gettable () { datatable dt = new DataTable (); dt. Columns.Add ("title", typeof (String)); for (int i = 1; I <= i++) { DataRow row = dt. NewRow (); row["title"] ="This is the article title" + i + ""; dt. Rows.Add (Row); } return dt} <</code>form id= "Form1" runat= "Server" > < </CODE>div> <</code>asp:repeater id= "rptlist" runat= "server" onitemdatabound= " Rptlist_itemdatabound "> <</CODE>HeaderTemplate> <</CODE>ul> </ </CODE>HeaderTemplate> <</CODE>ItemTemplate> <</CODE>li> < </code>asp:literal id= "Ltltitle" runat= "Server" ></</code>asp:literal></</code>li > </</CODE>ItemTemplate> <</CODE>FooterTemplate> </</CODE> ul></</code>footertemplate> </</CODE>asp:Repea</</CODE>form>