Monday, May 31, 2010

Exception: Error executing child request for ChartImg.axd

I got this exception when I used the charts built-in to .NET 3.5. The scenario in which I got this exception was only when the charts first appeared after postback.

Solution: In the web.config file add 'POST' to the DataVisualization verbs:
The old syntax:
<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" />

The new syntax:
<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
validate="false" />

No comments: