protected void Page_Load(object sender, EventArgs e) { try { string strCommand = ""; if (Session["strQuery"] != null) { strCommand = Session["strQuery"].ToString(); DataTable dtSearchResult = objBLL.Get_FilterWorklist(strCommand).Tables[0]; rpt1.DataSource = dtSearchResult; rpt1.DataBind(); if (Request.QueryString["Export"] != null) { pnlAddFollowUp.Visible = false; Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("Content-Disposition", "attachment; filename=JobProgress.xls;"); } } lblDt.Text = DateTime.Now.ToString("dd-MMM-yyyy"); } catch (Exception ex) { string js = "alert('Error in loading data!! Error: " + ex.Message + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true); } }
protected void filter_grid() { try { string strCommand = GetQuery(); Session["strQuery"] = strCommand; DataSet dtsSearchResult = objBLL.Get_FilterWorklist(strCommand); DataTable taskTable = new DataTable("TaskList"); taskTable = dtsSearchResult.Tables[0]; lblRecordCount.Text = dtsSearchResult.Tables[0].Rows.Count.ToString(); Session["TaskTable"] = taskTable; grdJoblist.DataSource = dtsSearchResult; grdJoblist.DataBind(); } catch (Exception ex) { ////.WriteError(this.GetType().Name.ToString(), System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex); string js = "alert('Error in loading data!! Error: " + UDFLib.ReplaceSpecialCharacter(ex.Message) + "');"; ScriptManager.RegisterStartupScript(this, this.GetType(), "error", js, true); } }