Home > Article > Backend Development > Repeater method to display separators at intervals between multiple lines
Repeater method to display separators at intervals between multiple lines. As shown in the picture
This example uses vs.net 2008 (C#) to write the background .CS code. From admin10000.com
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) < 15) { System.Web.UI.LiteralControl ul = new LiteralControl("
Frontend.aspx code
Download code example: PageDemo.RAR
Related documents: Paging implementation of Repeater control Repeater control implements editing, updating, and deletion operations Repeater
is used nested in RepeaterThe above is the detailed content of Repeater method to display separators at intervals between multiple lines. For more information, please follow other related articles on the PHP Chinese website!