asp.net - How to slice paging for every 5 pages -


"postprint" itemprop = "text">

I just want to cut paging of every 5 pages because there are too many pages so paging of the bottom is also crowded Are there.

  int category = id = convert toint32 (request .jQueryString ["id"]); Using (HEDataContext db = new HEDataContext ()) {var productlist = (p) in p.kategori_02_id == kategoriId select new {id = p.ID, name = p.Name, Bilgi = p.Bilgi , From IMG1 = PIMG1, IMG2 = P. IMG2, Calculation = DB. KTAGORI_03.Count ()} Leave (PG * 9). Take it (take); PagedDataSource page = new PagedDataSource (); Page. Approved custom paging = true; Page. Approved promotion = true; Page.DataSource = productList; Page Page size = 9; DLProductsList.DataSource = productList; DLProductsList.DataBind (); If (! IsPostBack) {CreatePagingControl (); }} Public Zero CreatePagingControl () {int totalPageCount = (CountTable () / 9) + 1; Int id = convert. ToInt32 (Request.JQueryString ["id"]); Int pg = Convert.ToInt32 (Request.JQueryString ["pg"]); Int kategori_01_id = Convert toInt32 (Request.JQueryString ["kategori_01_id"]); String lnk = ""; For (int i = 0; i <(CountTable () / 9) + 1; i ++) {if (pg == 0) {firstpage.Visible = false; last. View = false; } If (pg == (totalPageCount - 1)) {next.Visible = false; last page. View = false; } Firstpage.NavigateUrl = "Product-List.aspx kategori_01_id =?" + Kategori_01_id + "& id =" + id + "& amp; p = 0"; Previous.NavigateUrl = "? Product-list.aspx kategori_01_id =" + kategori_01_id + "& id =" + id + "& amp; p =" + (page-1) .toString (); Next.NavigateUrl = "product list.expex?ctigree_01_ id =" + category_01_ id + "and id =" + id + "and pg =" + (pg + 1) .restring (); Lastpage.NavigateUrl = "Product-List.aspx categori_01_id =?" + Kategori_01_id + "& id =" + id + "& amp; p =" + (totalPageCount - 1) .toString (); If (i == pg) lnk + = "& lt; span & gt;" + (I + 1) .ostring () + "& lt; / span & gt;"; The rest lnk + = "& lt; a href = 'Product-List.aspx kategori_01_id =?" + Kategori_01_id + "& id =" + id + "& amp; p =" + i.ToString () + '' & gt; "+ (I + 1) .ostring () +" & lt; / A & gt; "; Lnk + =" & amp; Nbsp; & Lt; Img src = 'picture / paging-pipe.gif' class = 'pagingpipe' alt = '' / / gt; & Amp; Nbsp; ";} LblPageName.Text = lnk;}  

This is a very common The problem is, you can do this by using a jQuery widget like this one below.

You only have to provide back-end implementation to get the data you need.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -