Then we need to add the code functionality to make the complete code work. First, we have to create a function that does the Binding for the list. Here is where the PagedDataSource object is used. Instead of doing the bind directly from the collection to the list, we have to bind it to the PagedDataSource object, this allows all the paging functionality for the List. Besides, we need to set the page index, this will be doing by the use of a session variable.Then we just bind the list to the PagedDataSource object like follows.

And that’s all. We run the demo and we have a CheckListBox with paging and with ajax.

It is important to point that we are initializing the paging using a simple int generic that fills with 150000 items. If we are going to the database, we have to use some other method for not keep going to the database each time we click next or previous, for example, storing your entity object inside a session variable or Serializing your object in the server side.