c# - 报告查看器配置错误 - 在网页的查看源中

标签 c# reportviewer

查看网页源代码时发现如下错误信息,但网页运行正常。我们的测试主管在执行断言测试时发现了错误。

报告查看器配置错误:

The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. Add

<add verb=" * " path="Reserved.ReportViewerWebControl.axd" 
     type="Microsoft.Reporting.WebForms.HttpHandler,Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" /> 

to the system.web/httpHandlers section of the web.config file, or add

<add name="ReportViewerWebControlHandler" preCondition="integratedMode"
     verb="*" path="Reserved.ReportViewerWebControl.axd"
     type="Microsoft.Reporting.WebForms.HttpHandler,Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" />

to the system.webServer/handlers section for Internet Information Services 7 or later

为什么在查看源代码时会出现此错误消息..

注意:此错误消息周围有一个 div 标记,它具有 style="display:none"

我试图找出原因,但每个人都只是将此错误消息讨论为网页中抛出的错误消息。建议对 web.config 进行的更改已存在于我们的配置文件中。

最佳答案

以下是我的解决方案:

<system.web>
  <httpHandlers>
    <add verb=" * "  path="Reserved.ReportViewerWebControl.axd" 
         type="Microsoft.Reporting.WebForms.HttpHandler,
               Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral,
               PublicKeyToken=b03f5f7f11d50a3a" />
  </httpHandlers>
</system.web>
<system.webServer>
  <handlers>
    <add name="ReportViewerWebControlHandler" preCondition="integratedMode"
         verb="*" path="Reserved.ReportViewerWebControl.axd" 
         type="Microsoft.Reporting.WebForms.HttpHandler, 
               Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral,
               PublicKeyToken=b03f5f7f11d50a3a"/>
  </handlers>
</system.webServer>

关于c# - 报告查看器配置错误 - 在网页的查看源中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11419059/

相关文章:

c# - 报表查看器未显示在表单设计器上(c# winform)

c# - 在后台从 RDLC 报告创建 PDF

asp.net - 尝试连接到报表服务器失败 - 在 ASP.NET 中设置 URL 和路径?

asp.net - 如何将多个报告添加到同一ReportViewer?

c# - 如何更改 C# 代码中的输入语言?

MySQL 求和与大小写查询

c# - 无法注册 IRelationalTypeMappingSource

c# - 将 Label 和 PickerView 放在 TableView 的同一行

c# - 搜索全局地址列表/书籍

c# - Task 返回异步方法的 ConditionalAttribute 的等价物