Hi,
I am using a number of gauges in a dashboard set up (asp.net 2.0, IGv8.1) and occasionally a gauge will not show up when the page loads. If I refresh the page the gauge then shows. My deployment scenario is as follows:
UltraGauge1.DeploymentScenario.ImageType = GaugeImageType.Png; UltraGauge1.DeploymentScenario.DeleteOldImages = true; UltraGauge1.DeploymentScenario.Mode = ImageDeploymentMode.FileSystem; UltraGauge1.DeploymentScenario.ImageURL = "~/images/SalesForce/Gauges/TargetKpi/Gauge_#CLIENT_#SESSION.#EXT"; UltraGauge1.DeploymentScenario.FilePath = "~/images/SalesForce/Gauges/TargetKpi";
The image url on the initial page load is:
http://localhost:4004/BlueCow/images/SalesForce/Gauges/TargetPax/Gauge_ctl00_cphMaster_tpgNational_UltraGauge1_nfctuj45qfghidy0xik0ds55.png?t=128709199775304415
And then when I refresh the page it is:
http://localhost:4004/BlueCow/images/SalesForce/Gauges/TargetPax/Gauge_ctl00_cphMaster_tpgNational_UltraGauge1_nfctuj45qfghidy0xik0ds55.png?t=128709201323972827
You can see how the timestamp (I'm guessing that's what "t" is) has changed slightly. This behaviour happens both locally, and when my site is deployed on a server. I'd say about 95% of the time the gauge image appears correctly, and the other 5% I need to refresh the page. I don't think an image has ever failed to load for me on refreshing.
Any help on this would be greatly appreciated.
Cheers,
James.
We loaded the latest version and hot fix and still have the problem.
Could you give me an example of how to evaluate if the gauge image is valid and then call refresh?
I will try that and see if it helps.
attach the javascript img.onerror event in the control markup, or in C#:
<igGauge:UltraGauge ID="UltraGauge1" runat="server" onerror="imageError();">
or
this.UltraGauge1.Attributes["onError"] = "imageError();";
here's the javascript imageError function:
function imageError() { ig_getWebControlById("UltraGauge1").refresh() }
Still seems to happen randomly. Calling refresh from Javascript will fix it sometimes, but not all of the time.
We have 4 gauges and a ultrawebgrid, all in an UpdatePanel. I also have an UltraChart on the page. When the grid is clicked, an async postback causes the gauge values to be updated. Two of the gauges are using the same preset and those are the ones that it happens with. I am loading them like this:
oGauge.LoadPreset(System.IO.Path.Combine(Request.PhysicalApplicationPath, "GaugePresets\\GlacierRadialRectangle.xml"), true);
Most of the time it seems to happen when it has been a while since the last click in the grid. Not sure why the other 2 gauges seem to handle that case and this one does not.
One of my other gauges is loading the preset "GaugePresets\\GlacierLinearVerticalThreeBars.xml". The other gauge is built all by code.
perhaps an exception is occurring in the async postback and you're not able to see it in the debugger. do you see anything in the output window of visual studio when this happens with a debugger attached?
i'm not sure if this will help, but it's worth a try - in the Debug > Exceptions menu in Visual Studio, try setting it to break on all CLR exceptions (even handled ones).
I tried turning on the thrown exceptions as you suggested, but it did not catch anything. So, I am not sure who is throwing the error yet. I will keep trying to figure out how to reproduce it.