Want 10 rows in every page while binding to a repeater

删除回忆录丶 提交于 2019-12-04 05:06:52

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!