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

Cancel loading RadChart

7 Answers 94 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Asha
Top achievements
Rank 1
Asha asked on 08 Feb 2012, 09:19 PM

I'm experiencing an intermittent error when cancelling the loading of a RadChart. During the load of a chart I log out of the application which causes the session to clear. After that I do a redirect to a log in page. Sometimes it works with no problem and sometimes I get an error. It is not consistent and I am testing locally on my development server.

Here is the error:

Error loading Radchart image.
  You may also wish to check the ASP.NET Trace for further details.
  Display stack trace? 

Here are my configurations:

<!-- this is appsetting for chart image --> 
  <add key="ChartImage_axd" value="storage=session;timeout=20;dir=~\img\chartimage" />

<system.web>
    <httpHandlers>
      <add path="ChartImage.axd" verb="*" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Version=2011.1.413.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4" validate="false" />
    </httpHandlers>
    <httpRuntime maxRequestLength="2048000" executionTimeout="3600" />
    <sessionState timeout="60"/>

  </system.web>

<system.webServer>
    <handlers>
      <add name="ChartImage_axd" verb="*" preCondition="integratedMode" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" />
    </handlers>
  </system.webServer>

Do you have any ideas on how I can fix the intermittent error?

Thank you!

7 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 10 Feb 2012, 04:26 PM
Hi Asha,

Here is how it works -- RadChart generates an image and places it in the session (this is by default). It also renders an <img> tag with src="ChartImage.axd?..." with certain arguments. When ChartImage.axd is requested the ChartHttpHandler retrieves the image from session. So, if you clear the session before the ChartHttpHandler has managed to retrieve the image you will get this error. A possible solution here would be to set UseSession=false and provide a folder where the chart will store temporarily the images as described here. This way RadChart will not use the session, so you should not experience such issues.

Best regards,
Ves
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Asha
Top achievements
Rank 1
answered on 23 Feb 2012, 09:16 PM
Hi,
I set UseSession=false and provide a folder where the chart will store temporarily the images as described above. Now I don't get error but I could see my old .png files sitting at that tempfolder. Do I've to code to delete those at end of application? if yes then how can I do that?
0
Ves
Telerik team
answered on 27 Feb 2012, 12:17 PM
Hi Asha,

ChartHttpHandler is supposed to delete the image files, however if this is not possible (e.g. file is locked) they will remain in the folder. Here is sample code, which you can add to Application_End event handler to delete them:

string[] files = Directory.GetFiles(MyTempImagesFolder);
foreach (string file in files)
   File.Delete(file);


Best regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
RamaKrishna P
Top achievements
Rank 1
answered on 11 Dec 2012, 06:43 AM
my old .png files sitting at that TempImg folder
still it is not working .........

Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
        ' Code that runs on application shutdown
        Dim files As String() = Directory.GetFiles("TempImg", "*.png")
        For Each file As String In files
            System.IO.File.Delete(file)
        Next
    End Sub

And

we are using Ajax Rad Chart for for live application i mean my chart will refresh for every second.it is working fine in IE browser and it is getting slow in Google Chrome
0
Ves
Telerik team
answered on 13 Dec 2012, 04:12 PM
Hello,

This code will be executed only on application end. If you need to clear the files more often, you may need to develop a separate application to delete the files in this folder.

Best regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
RamaKrishna P
Top achievements
Rank 1
answered on 22 Jan 2013, 12:13 PM
 i added httphandlers and web server handlers in web.confg file and usesession=false,TempImagesFolder ="TempImg" for rad chart control for my live data application, RadChart1.HttpHandlerUrl = ResolveUrl("ChartImage.axd") in codebehind. but still it is showing ERROR LOADING RADCHART IMAGE?.can u plz tell  me the posible solution.
0
Ves
Telerik team
answered on 25 Jan 2013, 09:16 AM
Hi,

Can you please show us the related parts of the web.config file?  In addition -- HttpHandlerUrl  property needs to be set in case you use url rewriter. Do you use one?

Best regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (Obsolete)
Asked by
Asha
Top achievements
Rank 1
Answers by
Ves
Telerik team
Asha
Top achievements
Rank 1
RamaKrishna P
Top achievements
Rank 1
Share this question
or