Take the 2-minute tour ×

I'm using the new asp.net chart control within a user control. I tried to use the output cache directive to cache the user control for 30 seconds. The caching is custom depending on the logged in user.

The chart data is being lost while the control is cached. I see the chart one every 30 seconds but at no point inbetween. Am I missing some cache option for the asp.net charting control?



share|improve this question
Can you post some example code? –  LukeH Feb 18 '09 at 18:09
have you solved the issue? May you post some example code? –  Gianpiero Caretti Sep 4 '12 at 9:26
add comment

2 Answers

[I guess I'll add my comment as an answer, in case it answers your question]

You're using the <% @OutputCache ... %> page directive? If so, that caches the page's output (ie the html), and will not retrieve datasources, or databind again until expiration of the cache. If you wanted to cache the datasource for your chart, you'd need to do that in code-behind:

Caching Reference: http://msdn.microsoft.com/en-us/library/18c1wd61(VS.80).aspx

Adding items to the cache: http://msdn.microsoft.com/en-us/library/system.web.caching.cache.add.aspx

To retrieve from the cache: http://msdn.microsoft.com/en-us/library/system.web.caching.cache.item.aspx

Does that help, or am I off-base?

share|improve this answer
Thanks carl, I think this is probably the route I'll have to take. I believe the issue is due to the chart image not being stored. I'll have to keep looking. –  Martin Feb 18 '09 at 16:30
add comment

You can set ImageStorageMode property to UseImageLocation. More information about image file management you can find here.

share|improve this answer
add comment

Your Answer


