【问题标题】:Failed to load resource: the server responded with a status of 406 (Not Acceptable) ==>promptengine-compressed.js加载资源失败:服务器响应状态为 406 (Not Acceptable) ==>promptengine-compressed.js
【发布时间】:2017-06-19 15:46:57
【问题描述】:

我正在开发应用程序,我们可以在其中托管 Crystal 报表并从应用程序运行它们。我遇到的问题是,当我尝试运行任何报告时显示空白屏幕。但它有水晶报告 UI.Print 导出等。但不会破坏显示此错误的报告 Like this

加载资源失败:服务器响应状态为 406(不可接受) aspnet_client/system_web/4_0_30319/crystalreportviewers13/promptengine-compressed.js

但是当我点击控制台错误时,它会打开 URL,然后如果我再次打开报告,它会在新选项卡中打开。但客户端不会这样做,所以我想解决这个问题。

在整个应用中,有两个地方我们用到了这个promptengine-compressed.js

一个是 crv.js

 bobj.crv.config = {
        isDebug : false, 
        scriptUri: null,  // The uri for the viewer script dir (that holds crv.js)
        skin: "skin_standard",
        needFallback: true, 
        lang: "en",
        useCompressedScripts: true,
        useAsync : true,
        indicatorOnly: false,
        resources : { 
            'HTMLPromptingSDK': { isLoaded: false, path: '../Scripts/promptengine-compressed.js' },
          'ParameterControllerAndDeps' : {isLoaded: false, path: '../../parameterUIController-compressed.js'}  
        },
        logging: { enabled: false, id: 0}
    };

我们在布局页面上引用的其他内容

   <script src="@Url.Content("../Scripts/promptengine-compressed.js")" type="text/javascript"></script>

【问题讨论】:

    标签: javascript asp.net asp.net-mvc crystal-reports http-status-code-406


    【解决方案1】:

    我已经解决了这个问题:

    浏览器期望“crystalreportviewers/promptengine-compressed.js”文件的 MIME 类型为 “应用程序/x-javascript,文本/javascript”。

    但在 IIS 中,在默认网站/应用程序(应用程序)级别,.js 文件的 MIME 类型是应用程序/javascript。 进行更改后,我就能看到报告。

    谢谢!

    https://www.experts-exchange.com/questions/28682818/406-Client-browser-IE10-does-not-accept-the-MIME-type-of-the-requested-page.html

    https://www.experts-exchange.com/questions/24977691/MIME-Type-for-Crystal-Reports-IIS-7.html

    【讨论】:

    • 你是怎么做到的?我在这个链接上看不到答案。
    猜你喜欢
    • 2012-12-14
    • 2018-06-08
    • 2021-07-22
    • 2017-04-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-01
    相关资源
    最近更新 更多