protected void btnExport_Click(object sender, EventArgs e) { string strRepTitle = grdChallan.Caption; string[] Resp = PrjClass.GenerateExcelReportFromGridView(grdChallan, strRepTitle); if (Resp[0] == "1") { Response.Redirect(Resp[1]); } else { lblMsg.Text = Resp[1]; Resp = PrjClass.GenerateCSVReportFromGridView(grdChallan, strRepTitle); if (Resp[0] == "1") { Response.Redirect(Resp[1]); } else { lblMsg.Text = " Could not provide Report at the time. Please try after some time." + Resp[1]; } } }