I've a problem with called javascript function after close response in code behind in ASP.Net Web Forms.

MY CODE:

string CloseJS = "<script>window.parent.SaveToSAVAction.Close();</script>";

httpContext.Response.Clear();
httpContext.Response.ContentType = "application/force-download";
httpContext.Response.AppendHeader("Content-Disposition",header);
httpContext.Response.BinaryWrite(viewModel.Create());
httpContext.Response.Flush();
httpContext.Response.Close();

Page.ClientScript.RegisterStartupScript(this.GetType(), "closeScript", CloseJS);

Maybe somebody know how fixed it, or know better way to download byte array.

Related posts

Recent Viewed