Daily Archives: 12/24/2009

Microsoft Chart for ASP.NET 3.5: Correctly setting image storage location

If you’re using Microsoft Chart control for .NET 3.5 you can specify where and how chart images are stored. And if for this purpose you’re trying to use Chart HTTP Handler setting in web config similar to this:

<add key="ChartImageHandler" value="storage=file;url=./Temp"/>

and it is failing (for example chart images are alway created in the root folder of your Web application) – there is an alternative. You can specify location of the images in properties of the chart control itself:

Just add relative path to your storage folder in front of the chart sequence string in “ImageLocation” property. and specify “UseImageLocation” for “ImageStorageMode” property