MSCharts “No http handler was found for request type 'GET'” error

前端 未结 4 1620
自闭症患者
自闭症患者 2020-12-17 08:44

I tried to install MSCharts on my Win2008 server. It installed without problem. Then I wrote in config.

But when I\'m trying to open page with charts it returned

相关标签:
4条回答
  • 2020-12-17 09:07

    Like Danil said, IIS7 requires that you put the handlers in

    <system.webserver>
        <handlers>
    

    Add the two lines below after the last add-in handles

    <add name="ChartImg" verb="*" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler,     System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"  />
    <add name="ReportViewer" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler,Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    
    0 讨论(0)
  • 2020-12-17 09:18

    This is what you need for ASP.NET 4.0 / IIS 7.5 on Windows 7:

    Your web.config must contain the following:

    <appSettings>
      <add key="ChartImageHandler" value="storage=file;timeout=20;" />
    </appSettings>
    
    
    <compilation targetFramework="4.0">
     <assemblies>
      <add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
     </assemblies>
    </compilation>
    
    <system.webServer>
    
    <handlers>
          <add name="ChartImg" verb="*" path="ChartImg.axd"  type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"  />
        </handlers>
    </system.webServer>
    

    You also need this at the top of your aspx page:

    <%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
    

    Hope this helps

    0 讨论(0)
  • 2020-12-17 09:19

    Don't know anything about MSCharts, but I'd say try changing the AppPool for the app to 'Classic .NET AppPool'.

    Alternatively, you may need to modify your web.config to add the handler in there. See Rick Strahl's post here.

    0 讨论(0)
  • 2020-12-17 09:22

    Solution was in web config. IIS7 required to write handlers inside system.webserver but not in the system.web. So I just move handler and add name attribute as it became required.

    0 讨论(0)
提交回复
热议问题