简体   繁体   English

如何解决“报告查看器 Web 控件 HTTP 处理程序尚未在应用程序的 web.config 文件中注册”

[英]How to resolve "The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file"

When working with an ASP.NET application, you receive the following error when attempting to view a page with the Microsoft ReportViewer control:使用 ASP.NET 应用程序时,尝试使用 Microsoft 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=9.0.0.0, 
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> to the system.web/httpHandlers section of the web.config file

The solution has two steps.解决方法有两个步骤。

Find the "system.webServer" section of the web.config and add the following lines to the "handlers" section.找到 web.config 的“system.webServer”部分,并将以下几行添加到“handlers”部分。 If your web.config doesn't have a "handlers" section, add it along with the new lines:如果您的 web.config 没有“处理程序”部分,请将其与新行一起添加:

<system.webServer>
    <handlers>
        <!-- Add these lines -->
        <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <validation validateIntegratedModeConfiguration="false"/>
    </handlers>
</system.webServer>

Then, Find the "system.web" section of the web.config and add the following lines to the "httpHandlers" section.然后,找到 web.config 的“system.web”部分并将以下几行添加到“httpHandlers”部分。

  <system.web>
    <httpHandlers>
      <!-- Add this line -->
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </httpHandlers>
  <system.web>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM