This is a migrated thread and some comments may be shown as answers.

Do Telerik Charts support ASP.NET page output caching?

2 Answers 104 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 30 Jun 2009, 03:27 PM

Hi,

I'm trying to use ASP.NET output caching (the @OutputCache directive) to cache pages containing a Telerik RadChart. However, it seems that after some amount of time the chart image URL becomes invalid, and I get an exception when I try to load a cached page. (Actually I get that RadChart popup saying "An error occurred, do you want to see a stack trace?" But if I say yes, all I get is a blank page and no stack trace.)

At first I thought it was because the RadChart is streamed through user session, and I figured that once the session was over for the user that generated the chart, then the chart url became invalid. This seemed reasonable, so I went ahead and changed the chart to UseSession=false and set a TempImagesFolder. With this change, my charts are still served up ok initially, but it failed to fix the problem since the URLs will still become invalid after some amount of time.

My chart image URLs currently look something like this: http://example.com/data/topic/ChartImage.axd?UseSession=false&ImageName=tMecfLN%2fISaQeq5zuhXMkN0UYsBhFjHusj3p4X09SIbwkrgJ7zslmK5GNw2FM%2bOaXQAMOHUlBAO6dlo3%2b0UKOQ%3d%3d&imageFormat=Png

So, do Telerik charts support ASP.NET page output caching? If so, how can I fix the behavior I'm seeing?

Thanks,

Dave

2 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 02 Jul 2009, 08:32 AM
Hello Dave,

Here is my reply to the support ticket you have posted:

Your observations are correct. Here is how it works - the image is generated, then it is put in the cache and it is deleted (from session or from the file system). The bad news is that the expiration is not exposed as a public property, so you cannot control how long the chart will be available.

I will forward your message to our developers for further investigation. Meanwhile, you can use the following workaround: use the
RadChart.Save() method to save the chart to an image. Then, rather than placing RadChart in the page, use regular Image control and set its ImageUrl property to point the saved image.

Sincerely,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mark Gregor
Top achievements
Rank 1
answered on 02 Jul 2009, 02:13 PM
Thanks, Ves. That's helpful.

I figured I could always save the file to disk and manually manage the cache, but I wasn't aware of the RadChart.Save() method. That will save me a bit of time. Thanks!

Regards,
Dave
Tags
Chart (Obsolete)
Asked by
David
Top achievements
Rank 1
Answers by
Ves
Telerik team
Mark Gregor
Top achievements
Rank 1
Share this question
or