Asp.Net: Charting Control (Error ChartImg.axd)

by Pieter Brinkman 3. March 2009 02:49

After installing and playing with the Asp.Net Charting control I decided to use it for a customer. When integrating the control to the project I got the following error

"Error executing child request for ChartImg.axd"

This error occurred because I did not update my web.config file. You have to add the following appSettingkey, httpHandler and handler.

<appSettings>
    <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFilesDit\;" />
</appSettings>
<httpHandlers>
    <add path="ChartImg.axd" verb="GET,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
</httpHandlers>


<handlers>
    <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</handlers>

More info about the Charting control:
http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx

Enjoy charting,
Pieter

Categories: ASP.Net | Controls | Microsoft

Comments

Scott
Scott United States on 4/13/2009 4:59:03 PM

Ever have the problem where IE shows the red "X" (image not found...) instead of the chart?

Pieter
Pieter on 4/14/2009 7:38:26 AM

Check the uri of the image. Does it go to a real file or a handler (ASHX)?

barackoli
barackoli United States on 4/26/2009 9:23:13 PM

useful post. thanks for sharing