【发布时间】:2015-02-17 08:01:18
【问题描述】:
在 ASP.Net Web 表单后面的代码中关闭响应后,我遇到了调用 javascript 函数的问题。
我的代码:
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);
也许有人知道如何修复它,或者知道下载字节数组的更好方法。
【问题讨论】:
标签: javascript c# asp.net .net webforms