public void Binddata() { string from = txtFrom.Text; string to = txtTo.Text; string username, catid, operator_id; if (Session["username"] != null || Session["operator_id"] != null) { username = Session["username"].ToString(); catid = Convert.ToString(Session["category"]); operator_id = Convert.ToString(Session["operator_id"]); } else { Session.Abandon(); Response.Redirect("~/Login.aspx"); return; } Hashtable htAddPlanParams = getParamsData(); Hashtable htResponse = new Hashtable(); Cls_Business_rptNew_Activation objTran = new Cls_Business_rptNew_Activation(); htResponse = objTran.GetSTBSWAPDet(htAddPlanParams, username); DataTable dt = null; //check for exception if (htResponse["htResponse"] != null) { dt = (DataTable)htResponse["htResponse"]; } if (dt == null) { Response.Redirect("~/ErrorPage.aspx"); return; } lblSearchParams.Text = Server.HtmlDecode("<b style='color:#094791;'></b><b>Transaction From : </b>" + from + "<b>Transaction To : </b>" + to); if (dt.Rows.Count == 0) { btngrnExel.Visible = false; grdNewActivation.Visible = false; lblSearchMsg.Text = "No data found"; } else { btngrnExel.Visible = true; grdNewActivation.Visible = true; lblSearchMsg.Text = ""; ViewState["searched_trans"] = dt; grdNewActivation.DataSource = dt; grdNewActivation.DataBind(); DivRoot.Style.Add("display", "block"); } }
protected void grdactdact_PageIndexChanging(object sender, GridViewPageEventArgs e) { grdNewActivation.PageIndex = e.NewPageIndex; Hashtable htAddPlanParams = getParamsData(); string username, catid, operator_id; if (Session["username"] != null || Session["operator_id"] != null) { username = Session["username"].ToString(); catid = Convert.ToString(Session["category"]); operator_id = Convert.ToString(Session["operator_id"]); } else { Session.Abandon(); Response.Redirect("~/Login.aspx"); return; } Cls_Business_rptNew_Activation objTran = new Cls_Business_rptNew_Activation(); Hashtable htResponse = objTran.GetSTBSWAPDet(htAddPlanParams, username); DataTable dt = null; //check for exception if (htResponse["htResponse"] != null) { dt = (DataTable)htResponse["htResponse"]; } if (dt == null) { Response.Redirect("~/ErrorPage.aspx"); return; } if (dt.Rows.Count == 0) { btngrnExel.Visible = false; grdNewActivation.Visible = false; lblSearchMsg.Text = "No data found"; } else { btngrnExel.Visible = true; grdNewActivation.Visible = true; lblSearchMsg.Text = ""; grdNewActivation.DataSource = dt; grdNewActivation.DataBind(); } }