Kavitha Kundena

Kavitha Kundena

  • NA
  • 21
  • 41k

Javascript not firing after openning excel sheet in asp.net

Jan 10 2013 3:53 AM
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)