private void PopulateUsers() { try { int startPage = !String.IsNullOrEmpty(Request.QueryString[WebConstant.QueryString.PagerQueryString]) ? TypeConversionUtility.ToInteger(Request.QueryString[WebConstant.QueryString.PagerQueryString]) : 1; int pageLength = !String.IsNullOrEmpty(Request.QueryString[WebConstant.QueryString.PageLengthQueryString]) ? TypeConversionUtility.ToInteger( Request.QueryString[WebConstant.QueryString.PageLengthQueryString]) : WebConstant.PageLength; int noOfPages = 0; int totalRecords = 0; var users = UserRepository.UserListPaged(null, startPage, pageLength, out noOfPages, out totalRecords); rptList.DataSource = users; rptList.DataBind(); #region "Paging" litPageState.Text = "Showing " + startPage + " of " + noOfPages + " (out of " + totalRecords + " items)"; if (totalRecords > users.Count) { ArgosPager argosPager = new ArgosPager(); argosPager.OutputFirstAndLastLinks = true; argosPager.OutputPageStats = false; argosPager.OutputPageJumper = false; argosPager.EnableGoToPage = false; argosPager.OutputNextPrevLinks = true; argosPager.NavigateNextText = ">"; argosPager.NavigatePreviousText = "<"; PagerBuilder.BuildPager(startPage, pageLength, noOfPages, totalRecords, false, litPager, WebConstant.PagerTextBoxId, WebConstant.QueryString.PagerQueryString, argosPager); // Binding Paging Css on Pager Literal Control string str = litPager.Text; str = str.Replace(" ", ""); litPager.Text = str; if (startPage != noOfPages) { int i = noOfPages / startPage; if (i > 0 && startPage != 1) IsLast = 2; else IsLast = 0; } else IsLast = 1; } else litPager.Text = ""; #endregion } catch (Exception ex) { lblMsg.Text = string.Format("<p class=\"error\">{0}</p>", ex); pnlMsg.Visible = true; } }
private void PopulateUsers() { try { int startPage = !String.IsNullOrEmpty(Request.QueryString[WebConstant.QueryString.PagerQueryString]) ? TypeConversionUtility.ToInteger(Request.QueryString[WebConstant.QueryString.PagerQueryString]) : 1; int pageLength = !String.IsNullOrEmpty(Request.QueryString[WebConstant.QueryString.PageLengthQueryString]) ? TypeConversionUtility.ToInteger( Request.QueryString[WebConstant.QueryString.PageLengthQueryString]) : WebConstant.PageLength; int noOfPages = 0; int totalRecords = 0; var users = UserRepository.UserListPaged(null, startPage, pageLength, out noOfPages, out totalRecords); rptList.DataSource = users; rptList.DataBind(); #region "Paging" litPageState.Text = "Showing " + startPage + " of " + noOfPages + " (out of " + totalRecords + " items)"; if (totalRecords > users.Count) { ArgosPager argosPager = new ArgosPager(); argosPager.OutputFirstAndLastLinks = true; argosPager.OutputPageStats = false; argosPager.OutputPageJumper = false; argosPager.EnableGoToPage = false; argosPager.OutputNextPrevLinks = true; argosPager.NavigateNextText = ">"; argosPager.NavigatePreviousText = "<"; PagerBuilder.BuildPager(startPage, pageLength, noOfPages, totalRecords, false, litPager, WebConstant.PagerTextBoxId, WebConstant.QueryString.PagerQueryString, argosPager); // Binding Paging Css on Pager Literal Control string str = litPager.Text; str = str.Replace(" ", ""); litPager.Text = str; if (startPage != noOfPages) { int i = noOfPages / startPage; if (i > 0 && startPage != 1) { IsLast = 2; } else { IsLast = 0; } } else { IsLast = 1; } } else { litPager.Text = ""; } #endregion } catch (Exception ex) { lblMsg.Text = string.Format("<p class=\"error\">{0}</p>", ex); pnlMsg.Visible = true; } }