private void BindProduct() { try { if (txtSearch.Text.Trim() != "Search") { objPI.SearchText = txtSearch.Text.Trim(); } else { objPI.SearchText = ""; } if (objPI.SortDirection == null && objPI.SortColumnName == null) { objPI.SortDirection = Convert.ToString(ViewState[Constants.SORTDERECTION]); objPI.SortColumnName = Convert.ToString(ViewState[Constants.SORTCOLUMNNAME]); } //List<Manufacturer> objData = new ManufacturerBLL().GetAll(objPI); BLL.Component.ProductBLL objprod = new BLL.Component.ProductBLL(); gvGrid.DataSource = objprod.GetAllProducts(objPI); gvGrid.DataBind(); } catch (Exception ex) { SendMail.MailMessage("CSWeb > Error > " + (new System.Diagnostics.StackTrace()).GetFrame(0).GetMethod().Name, ex.ToString()); } }