2
Answers

Javascript not firing after openning excel sheet in asp.net

Kavitha Kundena

Kavitha Kundena

11y
2.1k
1
Hi,

Am generating excel file from my code behind ,After generating excel file javascript is not firing.

Response.Clear();
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Expires = 0;
HttpContext.Current.Response.AddHeader("Content-Type", "application/vnd.ms-excel");"application/vnd.ms-excel";Response.ContentType =
Response.AddHeader(
xlWorkbook.SaveToStream("Content-Disposition", "attachment;filename=" + CommonFuncs.RandomString(new Random(), 32) + ".xls");
xlWorkbook.SaveToStream(
HttpContext
.Current.Response.OutputStream, SpreadsheetGear.FileFormat.Excel8);

//Response.End();

HttpContext.Current.Response.Flush();




ScriptManager.RegisterStartupScript(this, this.GetType(), "1", "EnableChkBox('" + enableCnt + "');", true);

Please Help!!!

Thanks
Kavitha

Answers (2)