必须在配置中注册 WebResource.axd 处理程序才能处理此请求 RDLC 报告运行时

问题描述

我知道这个问题之前已经讨论过了。但在我的情况下它是不同的。 每当我尝试显示 .rdlc 报告时,它都会给我一个例外。我不明白是什么原因。 我试图更改我的配置文件中的一些引用,但仍未解决。我错过了什么吗?

reportViewer1.LocalReport.EnableExternalImages = true;
ReportDataSource rds = new ReportDataSource("DataSet1",dtData);
reportViewer1.ProcessingMode = ProcessingMode.Local;
reportViewer1.LocalReport.DataSources.Add(rds);
reportViewer1.LocalReport.ReportPath = report_Path;

if (multipleDatasetSelected && SubReportSelected)
    reportViewer1.LocalReport.SubreportProcessing += LocalReport_SubreportProcessing;

if (lstParan.Count > 0)
{
   foreach (string key in lstParan.Keys)
   {
      reportViewer1.LocalReport.SetParameters(new ReportParameter(key,lstParan[key]));
    }
}

this.reportViewer1.LocalReport.Refresh(); 

每当最后一行运行this.reportViewer1.LocalReport.Refresh();。我在报告查看器中遇到异常 =>

The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
   <system.web>
       <httpHandlers>
           <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
       </httpHandlers>
   </system.web>
</configuration>
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: system.invalidOperationException: The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
   <system.web>
       <httpHandlers>
           <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
       </httpHandlers>
   </system.web>
</configuration>

Source Error:

An unhandled exception was generated during the execution of the current web request. information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[InvalidOperationException: The WebResource.axd handler must be registered in the configuration to process this request.

<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <httpHandlers>
            <add path="WebResource.axd" verb="GET" type="System.Web.Handlers.AssemblyResourceLoader" validate="True" />
        </httpHandlers>
    </system.web>
</configuration>]
   System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrlInternal(Assembly assembly,String resourceName,Boolean htmlEncoded,Boolean forSubstitution,IScriptManager scriptManager,Boolean enableCdn) +9810367
   System.Web.Handlers.AssemblyResourceLoader.GetWebResourceUrl(Type type,Boolean enableCdn) +201
   System.Web.UI.ClientScriptManager.GetWebResourceUrl(Page owner,Type type,Boolean enableCdn) +102
   System.Web.UI.ClientScriptManager.RenderWebFormsScript(HtmlTextWriter writer) +121
   System.Web.UI.Page.BeginFormRender(HtmlTextWriter writer,String formUniqueID) +984
   System.Web.UI.HtmlControls.Htmlform.renderChildren(HtmlTextWriter writer) +57
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.Htmlform.render(HtmlTextWriter output) +55
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,ControlAdapter adapter) +67
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer,ControlAdapter adapter) +101
   System.Web.UI.HtmlControls.Htmlform.renderControl(HtmlTextWriter writer) +43
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,ICollection children) +129
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +14
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,ControlAdapter adapter) +101
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer,ICollection children) +129
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +14
   System.Web.UI.Page.Render(HtmlTextWriter writer) +30
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer,ControlAdapter adapter) +101
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +27
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterasyncPoint) +1342

Version information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4330.0

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)