private void BindGrid(string category) { LocID = Convert.ToInt32(ViewState["LocID"]); catID = Convert.ToInt32(ViewState["CatID"]); List <Resource> reslist; ResourceHandler rs = new ResourceHandler(); if (LocID == 0) { reslist = rs.GetResourceListByCatID(catID); } else { reslist = rs.GetResourceListByCatIDandLocation(Convert.ToInt32(category), LocID); } grdResourceList.DataSource = reslist; grdResourceList.DataBind(); }