ASP. NET repeater control implements simple paging

Source: Internet
Author: User

Morning, there was a look at MSDN, and saw the

PagedDataSource class

Http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.pageddatasource (v=vs.110). aspx

Recall the previous insus.net only the GridView and DataList controls are customized for paging. The GridView and DataList pagination component and user control http://www.cnblogs.com/insus/archive/2009/03/19/1417102.html have never thought about paging repeater controls. Just use the Repeater control as a binding pen record or some small data set.


See the MSDN Page class today, and do not see Microsoft to the Repeater control listed in the introduction, is it true that the repeater control can not be paginated it?


See Demo:
Prepare the data source from the database first:


There is an instantiation class BIZBASESQLSP, this class specifically implemented, you can refer to the ASP. NET development, from two to three layers to object-oriented (3) "http://www.cnblogs.com/insus/p/3826706.html

Set a style (style) for the Repeater control:

When you create the Repeater control:

To set the paging status:

Now we can implement the code for the. CS page, implementing the paging state and binding to the Reeapter control, before implementing a property that needs to be written in order to store the index of the current page paged:


To implement paging and data-bound controls:



There are also two button events that are not implemented and are completed below:

Implementation Demo:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.