I have Microsoft Chart Controls set up in a Web Forms project. The chart is rendering as a broken image link. The page I'm attempting to add the chart control is in a location with this path:
http://localhost/application/default.aspx
The broken image link being generated is:
If I manually change the broken image link to the following, it renders:
Web.config:
<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" />;
<add key="ChartImg" value="Storage=memory;Timeout=20;"/>
(Also tried <add key="ChartImg" value="storage=file;timeout=20;dir=c:\TempImageFiles\;"/ >)
UPDATE
It's the actual location of the ChartImg.axd handler that is causing the problem. I think the page inheritance and namespaces are messed up in this huge legacy project. I'm trying to add the chart to a page in the /Application directory - I need to be able to change path to the handler. Anyone?
I was able to solve this by creating a new page in the project root with the same master page, and then using an iframe in the problematic page to bring in the charts. I could find no other way to programmatically change the "virtual" location of the ChartImg.axd handler itself.
<iframe src="../Metrics.aspx" height="400" width="400" frameborder="0"></iframe>