private void PopulateControls() { if (forumUser == null) { return; } using (IDataReader reader = ForumThread.GetPageByUser( userId, forumUser.SiteId, pageNumber, pageSize, out totalPages)) { string pageUrl = SiteRoot + "/Forums/UserThreads.aspx?" + "userid=" + userId.ToInvariantString() + "&pagenumber={0}"; pgrTop.PageURLFormat = pageUrl; pgrTop.ShowFirstLast = true; pgrTop.CurrentIndex = pageNumber; pgrTop.PageSize = pageSize; pgrTop.PageCount = totalPages; pgrTop.Visible = (pgrTop.PageCount > 1); pgrBottom.PageURLFormat = pageUrl; pgrBottom.ShowFirstLast = true; pgrBottom.CurrentIndex = pageNumber; pgrBottom.PageSize = pageSize; pgrBottom.PageCount = totalPages; pgrBottom.Visible = (pgrBottom.PageCount > 1); rptForums.DataSource = reader; rptForums.DataBind(); } }