private void GetChannels() { PagedDataSource pds = new PagedDataSource(); BLClient client = null; try { client = new BLClient(); pds.DataSource = client.GetChannelListByLetter(_activeLetter, _sort); } finally { client.Dispose(); } pds.AllowPaging = true; pds.PageSize = _pageSize; pds.CurrentPageIndex = CurrentPage; Prev.Visible = !pds.IsFirstPage; Next.Visible = !pds.IsLastPage; channelList.DataSource = pds; channelList.DataBind(); List <int> pageNumbers = CreatePageLinks(pds); pages.DataSource = pageNumbers; pages.DataBind(); }