Paging massive number of pages?

I am using a repeater control and implemented paging so that there is a Back, Forward and page numbering too. This works well! The problem is that if there are hundreds of pages this looks awful.

How can you implement a solution such as this:

Previous 1 2 3 4 5 6 7 8 9 10 … Next

So only ten pages are visible.

Many thanks guys (and girls)!