查看网页源代码时发现如下错误信息,但网页运行正常。我们的测试主管在执行断言测试时发现了错误。
报告查看器配置错误:
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/