public void Refresh(StyleGuide.API api, Int32 pPageNo) { StyleGuide.PagingInfo pgInf = null; if (pPageNo > 0) { pgInf = new StyleGuide.PagingInfo(); pgInf.RecordsPerPage = REC_PER_PAGE; pgInf.CurrentPage = pPageNo; } StyleGuide.SgCategories.Categories cats = null; if (!string.IsNullOrWhiteSpace(tbSearch.Text)) { if (this.rbSearchOpt.SelectedItem.Value == "C") { cats = api.getAllCategoriesNameContains(tbSearch.Text, pgInf); } else { cats = api.getAllCategoriesNameStartsWith(tbSearch.Text, pgInf); } } else { cats = api.getAllCategories(pgInf); } this.gvCatList.DataSource = cats; this.gvCatList.DataBind(); SetPaging(cats, (pPageNo == -1 ? true : false)); }