문제

is there pageindex or pagecount for repeater? i able to do with gridview and could not find much with repeater and not in code-behind too, how would i do PageIndex and PageCount in Repeater?

 Page <%# rpt.PageIndex + 1 %> of <%# rpt.PageCount %>


<asp:Repeater ID="rpt" runat="server" OnItemCommand="rpt_OnItemCommand" OnItemDataBound="rpt_OnItemDataBound">
    <HeaderTemplate>
           <div >
                <div >
                     Page <%# rpt.PageIndex + 1 %> of <%# rpt.PageCount %>
                </div>
            </div>
     </HeaderTemplate>
     <ItemTemplate ......
</asp:Repeater>
도움이 되었습니까?

해결책

Repeater control does not support paging out of the box, which means you have to implement it yourself. One way (and the easiest probably) is to use PagedDataSource object, which encapsulates paging-related properties and logic. There is a couple of examples in web on how to accomplish this: example one, example two, example three.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top