Error “System.EventArgs: Error executing child request for ChartImg.axd…”

Posted: September 2, 2011 in ASP.Net Microsoft Chart

While working with Microsoft Charting Control and .Net 3.5, I ran into an issue where I kept getting the error System.EventArgs: Error executing child request for ChartImg.axd… After searching on the web and other forums and trying a few things out, I was able to get it working by doing the following:

web.config
Make sure the following is set in your appSettings tag:

<appSettings>
  <add key="ChartImageHandler" value="Storage=file;Timeout=20;Url=TempImages/;"/>
</appSettings>

Make sure the following is set in your httpHandlers tag:

<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>

Make sure the following is set in your handlers tag and remember to put POST in it as well:

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

File Server
Make sure you have a folder called TempImages on the same level as the file that is calling the chart control. For my example, I had the file and folder on the rool level of the application.
ASPX Page
Where you have created the chart control, make sure you have set these properties. For my example I was doing a 3D pie chart:

<asp:Chart id="Chart1" ImageStorageMode="UseImageLocation" runat="server" ImageLocation="TempImages/ChartPic_#SEQ(300,3)" EnableViewState="true">
...
</asp:Chart>

For further information you can read the following post.

Advertisements
Comments
  1. Kaushal Jani says:

    Hi,

    I have applied Form Authentication in my web application. Before then that all works like charm but after that I am started to get this error.

    Using above Help I have resolved my error and all works like charm.

    Thank you so much.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s