在我開發的網站中,單擊鏈接時,會打開一個顯示PDF文件的新瀏覽器窗口。它可以在除IE 8以外的所有瀏覽器上運行。IE 8顯示空的瀏覽器窗口。當我檢查時,文件是由瀏覽器下載的,但瀏覽器不顯示PDF文件。這讓我陷入了很長時間,最終它被一位同事解決了。我想在此分享解決方案,以便其他人不必經歷我經歷的痛苦。PDF在Internet Explorer 8中未打開
0
A
回答
2
在該網站中,我們禁用緩存以阻止用戶使用瀏覽器後退按鈕倒退。
HttpCacheability.NoCache
IE 8要求在顯示之前將要顯示的任何文件保存在臨時文件中。禁用緩存中斷保存到臨時文件。即使瀏覽器成功下載了文件,由於它無法保存文件,它並未顯示使用活動x顯示的pdf內容或任何其他文檔。我們瞭解到,這是一個IE 8的bug,它在IE 9中得到了修復。
將緩存更改爲私人修復問題。
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.ClearHeaders();
Response.ContentType = "Application/pdf";
Response.WriteFile(path);
相關問題
- 1. 彈出來打開PDF在Internet Explorer
- 2. 使用嵌入式PDF打開Internet Explorer
- 3. 在Internet Explorer 8
- 4. 在Internet Explorer中PDF導出打印
- 5. pdf文件未顯示在Internet Explorer中
- 6. 機器人框架Internet Explorer未打開
- 7. internet-explorer BHO PDF
- 8. 無法在Internet Explorer中打開動態PDF文件
- 9. 在Internet Explorer中以二進制格式打開PDF
- 10. PDF文件在Internet Explorer中打開時彈出
- 11. 無法使用Internet Explorer在SharePoint 2010中打開PDF文件
- 12. Facebook FriendsList窗口無法在Internet Explorer 8中打開
- 13. 在Internet Explorer 8中打開txt文件解析一些html
- 14. Internet Explorer 8 + Deflate
- 15. javascript.window.open:open只在Internet Explorer中打開頁面
- 16. 用cmd在Internet Explorer中打開標籤
- 17. 的Internet Explorer 8和Internet Explorer 6並排
- 18. JavaScript和Internet Explorer 8
- 19. Jsrender IE 8(Internet Explorer)
- 20. Internet Explorer 8和CSS
- 21. jQuery setInterval Internet Explorer 8
- 22. Internet Explorer 8和CSS3
- 23. Internet Explorer 8.事件
- 24. Windows XP中的Internet Explorer 8
- 25. Windows 7中的Internet Explorer 8
- 26. AngularJS不會在Internet Explorer 8
- 27. 的jCarousel在Internet Explorer 8
- 28. Object.onload在Internet Explorer 6,7和8
- 29. phpMyFaq不會在Internet Explorer 8中導出PDF
- 30. 從Google Chrome中打開Internet Explorer
隨時分享。 – PiLHA
我不明白你爲什麼給-1。我只是試圖幫助。 – neo
我沒有。我鼓勵他分享。 – PiLHA