How to slice paging for every 5 pages
<p>I just want to slice paging every 5 pages because there are too many pages that's why the paging of the bottom looks too crowded.</p>

<pre><code>        int kategoriId = Convert.ToInt32(Request.QueryString["ID"]);

        using (HEDataContext db = new HEDataContext())
        {

            var productList = (from p in db.KATEGORI_03s
                              where p.kategori_02_id == kategoriId
                              select new 
                              {
                                ID= p.ID,
                                Name = p.Name,                                    
                                Bilgi = p.Bilgi,
                                Img1 = p.Img1,
                                Img2 = p.Img2,
                                Count = db.KATEGORI_03s.Count()
                              }).Skip(pg * 9).Take(take);


            PagedDataSource page = new PagedDataSource();
            page.AllowCustomPaging = true;
            page.AllowPaging = true;
            page.DataSource = productList;
            page.PageSize = 9;

            DLProductsList.DataSource = productList;
            DLProductsList.DataBind();

            if (!IsPostBack)
            {
                CreatePagingControl();
            }

        }




    public void CreatePagingControl()
    {

        int totalPageCount = (CountTable() / 9) + 1;
        int ID = Convert.ToInt32(Request.QueryString["ID"]);
        int pg = Convert.ToInt32(Request.QueryString["pg"]);
        int kategori_01_id = Convert.ToInt32(Request.QueryString["kategori_01_id"]);

        string lnk = "";

        for (int i = 0; i &lt; (CountTable() / 9) + 1; i++){


            if (pg == 0)
            {
                firstpage.Visible = false;
                previous.Visible = false;
            }


            if (pg == (totalPageCount - 1))
            {
                next.Visible = false;
                lastpage.Visible = false;
            }


            firstpage.NavigateUrl = "Products-List.aspx?kategori_01_id=" + kategori_01_id + "&amp;ID=" + ID + "&amp;pg=0";
            previous.NavigateUrl = "Products-List.aspx?kategori_01_id=" + kategori_01_id + "&amp;ID=" + ID + "&amp;pg=" + (pg - 1).ToString();
            next.NavigateUrl = "Products-List.aspx?kategori_01_id=" + kategori_01_id + "&amp;ID=" + ID + "&amp;pg=" + (pg + 1).ToString();
            lastpage.NavigateUrl = "Products-List.aspx?kategori_01_id=" + kategori_01_id + "&amp;ID=" + ID + "&amp;pg=" + (totalPageCount - 1).ToString();


            if (i == pg)  
                lnk += "&lt;span&gt;" + (i + 1).ToString() + "&lt;/span&gt;";
            else
                lnk += "&lt;a href='Products-List.aspx?kategori_01_id=" + kategori_01_id + "&amp;ID=" + ID + "&amp;pg=" + i.ToString() + "'&gt;" + (i + 1).ToString() + "&lt;/a&gt;";


            lnk += "&amp;nbsp;&lt;img src='images/paging-pipe.gif' class='pagingpipe' alt='' /&gt;&amp;nbsp;";

        }

        lblPageName.Text = lnk;

    }
</code></pre>
