Recently I had a requirement to customize the OOB SharePoint search results paging control (SearchPagingWebPart). So below is the problem definition and the solutions I came across. (the link to the downloadable source code for the solution is attached at the end of the post)
OOB paging control gives you several options to specify and define the paging behavior.
Most important properties for me are the first two ones.
1) Maximum page links before current
2) Maximum page links after current
So with the above configuration paging will look like this:
Its fare enough so the current page is 1 and there are no pages to be displayed as previous links. so it will display only 3 after links.
When you navigate to a page in the middle it will look like this:
So its now displaying 4 before links with page numbers and 3 after links.