public void DegerleriYukle() { string page = Request.QueryString["Page"]; string searchText = Request.QueryString["query"]; if (page == null) { page = "1"; } int howManyPages = 1; string firstPageUrl = ""; string pagerFormat = ""; if (searchText != null) { string allWords = Request.QueryString["AllWords"]; DataTable dt = CatalogAccess.Search(searchText, allWords, page, out howManyPages); if (dt.Rows.Count == 0) { lblNotFound.Visible = true; lblNotFound.Text = "<h3> Hiç Sonuç Bulunamadı :( </h3>"; } ListViewProductsOfCategory.DataSource = dt; ListViewProductsOfCategory.DataBind(); firstPageUrl = Link.ToSearch(searchText, allWords.ToUpper() == "TRUE", "1"); pagerFormat = Link.ToSearch(searchText, allWords.ToUpper() == "TRUE", "{0}"); } topPager.Show(int.Parse(page), howManyPages, firstPageUrl, pagerFormat, true); bottomPager.Show(int.Parse(page), howManyPages, firstPageUrl, pagerFormat, true); }
public void DegerleriYukle() { string page = Request.QueryString["Page"]; string categoryID = Request.QueryString["CategoryID"]; if (page == null) { page = "1"; } int howManyPages = 1; string firstPageUrl = ""; string pagerFormat = ""; if (categoryID == null || categoryID == "") { ListViewProductsOfCategory.DataSource = CatalogAccess.GetAllProducts(page, out howManyPages); ListViewProductsOfCategory.DataBind(); int currentPage = Int32.Parse(page); firstPageUrl = Link.ToAllProducts(page); pagerFormat = Link.ToAllProducts("{0}"); } else if (categoryID != null) { ListViewProductsOfCategory.DataSource = CatalogAccess.GetAllProductsInCategory(categoryID, page, out howManyPages); ListViewProductsOfCategory.DataBind(); int currentPage = Int32.Parse(page); firstPageUrl = Link.ToCategory(categoryID, "1"); pagerFormat = Link.ToCategory(categoryID, "{0}"); } else { Response.Redirect("404.aspx"); } topPager.Show(int.Parse(page), howManyPages, firstPageUrl, pagerFormat, true); bottomPager.Show(int.Parse(page), howManyPages, firstPageUrl, pagerFormat, true); }