【发布时间】:2012-06-14 07:02:08
【问题描述】:
我有几个可以通过浏览器成功显示“标准”文档的应用程序。我使用互联网上大多数示例使用的正常方式来显示文档,即
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearContent();
response.ClearHeaders();
response.Buffer = true;
response.ContentType = "application/pdf";
response.AddHeader("Content-Disposition", "attachment;filename=file.pdf";
response.BinaryWrite(SomeBinaryArrayObject);
response.Flush();
response.End();
但是,在我当前的应用程序中,这是从 UpdatePanel 调用的,这似乎会导致 AJAX 错误(我也发现了谷歌搜索):
Check here for the error message I received
我想知道除了使用 Response.write 之外,是否有任何其他方式从浏览器调用文档,或者是否有任何方式围绕 AJAX/Response。写问题?我希望它们在浏览器中打开,但如果它们在关联的应用程序中打开,那也很好,我们的大多数客户(如果不是所有)都安装了 Adobe 和 MS Office 之类的东西。
欢迎任何帮助!
【问题讨论】: