The Paginated repeater is an extension of the standard repeater to add in pagination capabilities. It is does it by wrapping the datasource with the PagedDataSource, which is a data source wrapper available in asp.net. I added in a NumberOfPagesToShow attribute, which determines how many of the numbers to show at the top of control to move through the pages before showing a .... The TableWidth attribute, which is used to put into the table which creates the pagination details at the top of the control. PageSize and PageIndex are both pretty much straightforward in what they do.
The PaginatedRepeater works by overloading the OnLoad function to find the datasource at that point in time and pass it on down to the main Repeater object. It also determines if the request is a post back and sets the page index to the correct value. The DataBind() call at the bottom of this function connects up and completes the data binding of the object, this is what connects the repeater to the actual data for rending.
The OnPreRender function is used to register a field which keeps track of the next page, this allows the javascript code to correctly move onto the next page when the next and previous buttons are clicked on the page. The OnPreRender function also registers the javascript to be used in the control.
The Render function does all the work, it wraps a table around the actual control which puts in the numbers, the current page number and works out which numbers to actually show. It switches on the PagerButtons enumerate type, that is used in other pager objects, to determine what type of pagination buttons to use and show. The NavigateUrl on the controls are setup with javascript to do the pagination. The code to this class is included below.