加载资源失败:服务器响应状态为 406(不可接受)==>promptengine-compressed.js

Failed to load resource: the server responded with a status of 406 (Not Acceptable) ==>promptengine-compressed.js

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

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

但是当我点击控制台错误时它会打开 URL 它会在一个新的选项卡中打开之后如果我再次打开报告它 work.but 客户端不会这样做所以我想修复这个问题。

在整个应用中,我们有两个地方使用了这个提示引擎-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>

我已经解决了这个问题:

浏览器期望“crystalreportviewers/promptengine-compressed.js”文件的 MIME 类型为 'application/x-javascript, text/javascript'。

但是在 IIS 中,在默认 Web Site/Application(应用程序)级别,.js 文件的 MIME 类型是 application/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