private void Bind() { PagedDataSource ps = new PagedDataSource(); ps.DataSource = bll.ShowAllEmployee(); ps.AllowPaging = true; ps.PageSize = 9; lbPage.Text = ps.PageCount.ToString(); ps.CurrentPageIndex = currentPage; FirstPage.Enabled = true; PriorPage.Enabled = true; NextPage.Enabled = true; LastPage.Enabled = true; if (lbCurrentPage.Text == "1") { FirstPage.Enabled = false; PriorPage.Enabled = false; } if (lbCurrentPage.Text == ps.PageCount.ToString()) { NextPage.Enabled = false; LastPage.Enabled = false; } EmployeeDataList.DataSource = ps; EmployeeDataList.DataKeyField = "ID"; EmployeeDataList.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { EmployeeDataList.DataSource = bll.ShowEmployee(); EmployeeDataList.DataBind(); }