问题
I have a repeater which is bound to a data source having 500 rows.I don't want it for paging. Simple when the rows are coming to repeater they grow down.So ,suppose i have 10 pages, each page having 50 rows in the browser print preview, when i am printing the document with ctrl+p command.
so,is there any way , so that my page will contain only 10 rows and with header and footer in every page.
Thanks Manas
回答1:
You can add inside the repeater an if, then, Write
call, using also a public integer value from code behind, as:
public int ImetritisReapeter = 1;
and on the page:
<asp:Repeater ID="rMyID" runat="server">
<ItemTemplate>
<% if (ImetritisReapeter++ % 10 == 0) {
Response.Write("<br>Extra header ever 10 lines");
} %>
</ItemTemplate>
</asp:Repeater>
来源:https://stackoverflow.com/questions/12122440/want-10-rows-in-every-page-while-binding-to-a-repeater