I have a page that displays a pie chart using the Rad Chart control and occasionally the image of the chart is not loaded. This seems to be a timing problem because often it does work fine. I used Fiddler to find out what is happening and here is what I found:
The Rad Chart control gets rendered to an image tag with the source URL similar to the one below
<AppPath>/RadControls/Chart/Image.aspx?UseSession=true&ChartID=e4c892b6-906a-40ce-af05-80314f8103b4_chart_ctl00$MC$ConceptDisplay$ctl01$InteractionList$ctl00$ProfileGroupSplitRadChart&imageFormat=Png&random=0.973745745128834
I opened the page into several browser windows, some of which showed the chart correctly and some came up with the chart image missing. When I checked the image requests in Fiddler I saw that in cases where the image showed correctly the request obviously returned a PNG image and in the other cases it actually returned an error page. The error page never gets shown as these were source requests from an HTML image tag but Fiddler allowed me to inspect the content of that error page and it shows the error message “Error: Specified argument was out of the range of valid values. Parameter name: offset”. This error is thrown from within the Rad Chart control’s Image.aspx file which is an empty aspx file without code behind that inherits from Telerik.WebControls.Dialogs.ChartImage.
All this suggests that there might be some timing issue where the chart image is not yet created or may not yet be saved to the session state when Image.aspx tries to access it. I have to add that the site containing this page with the chart is load balanced using Windows NLB. The session state is configured as following: <sessionState mode="SQLServer" … cookieless="false" timeout="60"/>.
Is there some simple trick to ensure that the chart image is created and saved to the session state before the browser can request it? For instance would it be possible to delay the rending of the page or the chart control by fractions of a second so that the browser cannot load the images before it is saved to the session state? Or are there any other suggestions to fix this problem?
The Rad Chart control gets rendered to an image tag with the source URL similar to the one below
<AppPath>/RadControls/Chart/Image.aspx?UseSession=true&ChartID=e4c892b6-906a-40ce-af05-80314f8103b4_chart_ctl00$MC$ConceptDisplay$ctl01$InteractionList$ctl00$ProfileGroupSplitRadChart&imageFormat=Png&random=0.973745745128834
I opened the page into several browser windows, some of which showed the chart correctly and some came up with the chart image missing. When I checked the image requests in Fiddler I saw that in cases where the image showed correctly the request obviously returned a PNG image and in the other cases it actually returned an error page. The error page never gets shown as these were source requests from an HTML image tag but Fiddler allowed me to inspect the content of that error page and it shows the error message “Error: Specified argument was out of the range of valid values. Parameter name: offset”. This error is thrown from within the Rad Chart control’s Image.aspx file which is an empty aspx file without code behind that inherits from Telerik.WebControls.Dialogs.ChartImage.
All this suggests that there might be some timing issue where the chart image is not yet created or may not yet be saved to the session state when Image.aspx tries to access it. I have to add that the site containing this page with the chart is load balanced using Windows NLB. The session state is configured as following: <sessionState mode="SQLServer" … cookieless="false" timeout="60"/>.
Is there some simple trick to ensure that the chart image is created and saved to the session state before the browser can request it? For instance would it be possible to delay the rending of the page or the chart control by fractions of a second so that the browser cannot load the images before it is saved to the session state? Or are there any other suggestions to fix this problem?