Click here to Skip to main content
14,975,219 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can anyone suggest where to fond example code to insert a page break in an asp.net repeater? Code attached.
Posted
Comments
RDBurmon 13-Jun-12 9:31am
   
Thanks Everyone who replied to this thread , So Robert, I think you have got enough responses and you should be able to mark it as your answer and close the thread. Please do so.

On web? Top link in Google search[^] for the same:
Insertion of a page break in a repeater[^]
   
Protected Sub rpt_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rpt.ItemDataBound
        If e.Item.ItemType = ListItemType.Item Then
            Dim row As Data.DataRowView = CType(e.Item.DataItem, Data.DataRowView)
            If Not e.Item.ItemIndex = row.DataView.Count Then
                Dim l As New Literal
                l.Text = "<hr size='1' style='PAGE-BREAK-AFTER: right; color: #FFFFFF;'>"
                e.Item.Controls.Add(l)
            End If
        End If
    End Sub


Hope this can help you. This code is in VB.Net. Convert it to C#.
   
v2
this code doesnt work can any one provide the solution for this problem
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900