title: How should i code this paging?
body: <p>I've been struggling with some code for a paging for a couple of days (YES! days) now but can't get it to work properly, probably because I don't have any experience on this kind of problems yet.</p>
  
  <p>the paging I'm trying to do should look something like this:</p>
  
  <blockquote>
    <p><strong>1</strong> 2 3 4 5 6 ... 101</p>
  </blockquote>
  
  <p>When i click on number 5 i would like it to display the numbers like this:</p>
  
  <blockquote>
    <p>1 ... 3 4 <strong>5</strong> 6 7 ... 101</p>
  </blockquote>
  
  <p>when I'm at the last couple of pages i want it to look similar to the first one:</p>
  
  <blockquote>
    <p>1 ... 96 97 <strong>98</strong> 99 100 101</p>
  </blockquote>
  
  <p>The bold number is the page that you're currently viewing.</p>
  
  <p>I want the dots to appear only when there is more than 7 pages available, if not it should look like a normal paging would look like:</p>
  
  <blockquote>
    <p><strong>1</strong> 2 3 4 5 6 7</p>
  </blockquote>
  
  <p>Right now i want to display 10 items per page.</p>
  
  <p>The language i want to use is C# (ASP.NET) and would like to, later on make this a usercontrol (Where i should set the properties TotalNumberOfItems, ItemsPerPage and so on).</p>
  
  <p>The question: 
  How do i write the code to loop out the numbers on the correct places? :)</p>