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.
The timestamp is just to prevent the browser from using a cached version of the image file, so I don't think it's relevant to this issue.
Try testing this with the latest available hotfix from our website, as it's possible some related fixes were made since the initial release of 8.1. If that doesn't help, try checking if the image file exists on your server once the page loads with the missing image - that will at least hint at the nature of this problem, whether it's a timing issue or if the image simply isn't generated the first time.
David,
when the image is missing from the page, the image is not created on the server. Once I refresh the page the image file appears on the server (and the web page). I thought I mentioned this in my first post but I must have just thought it and not written it. :-)
I will try the latest hotfix and see how that goes.
James
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.
I just noticed that when the error happens the function ig_getWebControlById(oGauge.id) returns back as "undefined". My variable oGauge is valid. Here are the other properties on oGauge if that helps. Notice that "fileSize" is -1.
- oGauge {object} DispHTMLImg+ [Methods] + [Events] accessKey "" String align "" String+ all {Count = 0} DispHTMLElementCollection alt "" String+ attributes {Count = 100} DispHTMLAttributeCollection+ behaviorUrns {...} IHTMLUrnCollection border "" String canHaveChildren false Boolean canHaveHTML false Boolean+ childNodes {Count = 0} DispDOMChildrenCollection+ children {Count = 0} DispHTMLElementCollection className "" String clientHeight 0 Long clientLeft 0 Long clientTop 0 Long clientWidth 0 Long complete false Boolean contentEditable "inherit" String+ currentStyle {...} DispHTMLCurrentStyle dataFld "" String dataFormatAs "" String dataSrc "" String dir "" String disabled false Boolean+ document {object} DispHTMLDocument dynsrc "" String fileCreatedDate "" String fileModifiedDate "" String fileSize "-1" String fileUpdatedDate "" String+ filters {...} IHTMLFiltersCollection firstChild null IHTMLDOMNode height 0 Long hideFocus false Boolean href "http://localhost/ProjectManagerBranch/GaugeImages/ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3_vi3q5mmfgy0snq45qjgro145.png?t=128842120573364863" String hspace 0 Long id "ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3" String innerHTML "" String innerText "" String isContentEditable false Boolean isDisabled false Boolean isMap false Boolean isMultiLine true Boolean isTextEdit false Boolean lang "" String language "" String lastChild null IHTMLDOMNode longDesc "" String loop 1 Long lowsrc "" String mimeType "" String name "" String nameProp "ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3_vi3q5mmfgy0snq45qjgro145.png?t=128842120573364863" String+ nextSibling { } DispHTMLDOMTextNode nodeName "IMG" String nodeType 1 Long nodeValue null Variant offsetHeight 0 Long offsetLeft 0 Long+ offsetParent {object} DispHTMLTableCell offsetTop 0 Long offsetWidth 0 Long outerHTML "<IMG id=ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3 title="Variance = -27.370" style="BACKGROUND-COLOR: transparent" alt="" onerror=imageError(this); src="/ProjectManagerBranch/GaugeImages/ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3_vi3q5mmfgy0snq45qjgro145.png?t=128842120573364863">" String outerText "" String+ ownerDocument {object} DispHTMLDocument+ parentElement {object} DispHTMLTableCell+ parentNode {object} DispHTMLTableCell+ parentTextEdit {object} DispHTMLBody previousSibling null IHTMLDOMNode protocol "HyperText Transfer Protocol" String readyState "uninitialized" String recordNumber null Variant+ runtimeStyle {object} DispHTMLStyle scopeName "HTML" String scrollHeight 0 Long scrollLeft 0 Long scrollTop 0 Long scrollWidth 0 Long sourceIndex 186 Long src "http://localhost/ProjectManagerBranch/GaugeImages/ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3_vi3q5mmfgy0snq45qjgro145.png?t=128842120573364863" String Start "fileopen" String+ style {object} DispHTMLStyle tabIndex 0 Integer tagName "IMG" String tagUrn "" String title "Variance = -27.370" String uniqueID "ms__id2" String uniqueNumber 2 Long useMap "" String vrml "" String vspace 0 Long width 0 Long
interesting, but still hard to understand what's really going on. does document.getElementById(oGauge.id) return undefined as well?
it might help to test this out using Firebug, the firefox extension. it contains a tab for monitoring network activity on a given page, so you could use it to inspect what is coming back when a new gauge image is requested via an ajax request.
Getting the element works. Here are the element properties:
- document.getElementById(oGauge.id) {object} DispHTMLImg+ [Methods] + [Events] accessKey "" String align "" String+ all {Count = 0} DispHTMLElementCollection alt "" String+ attributes {Count = 100} DispHTMLAttributeCollection+ behaviorUrns {...} IHTMLUrnCollection border "" String canHaveChildren false Boolean canHaveHTML false Boolean+ childNodes {Count = 0} DispDOMChildrenCollection+ children {Count = 0} DispHTMLElementCollection className "" String clientHeight 0 Long clientLeft 0 Long clientTop 0 Long clientWidth 0 Long complete false Boolean contentEditable "inherit" String+ currentStyle {...} DispHTMLCurrentStyle dataFld "" String dataFormatAs "" String dataSrc "" String dir "" String disabled false Boolean+ document {object} DispHTMLDocument dynsrc "" String fileCreatedDate "" String fileModifiedDate "" String fileSize "-1" String fileUpdatedDate "" String+ filters {...} IHTMLFiltersCollection firstChild null IHTMLDOMNode height 0 Long hideFocus false Boolean href "http://localhost/ProjectManagerBranch/GaugeImages/ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3_e2b4x1umsfc0saejealcch55.png?t=128843623079367695" String hspace 0 Long id "ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3" String innerHTML "" String innerText "" String isContentEditable false Boolean isDisabled false Boolean isMap false Boolean isMultiLine true Boolean isTextEdit false Boolean lang "" String language "" String lastChild null IHTMLDOMNode longDesc "" String loop 1 Long lowsrc "" String mimeType "" String name "" String nameProp "ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3_e2b4x1umsfc0saejealcch55.png?t=128843623079367695" String+ nextSibling { } DispHTMLDOMTextNode nodeName "IMG" String nodeType 1 Long nodeValue null Variant offsetHeight 0 Long offsetLeft 0 Long+ offsetParent {object} DispHTMLTableCell offsetTop 0 Long offsetWidth 0 Long outerHTML "<IMG id=ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3 title="Variance = -27.370" style="BACKGROUND-COLOR: transparent" alt="" onerror=imageError(this); src="/ProjectManagerBranch/GaugeImages/ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3_e2b4x1umsfc0saejealcch55.png?t=128843623079367695">" String outerText "" String+ ownerDocument {object} DispHTMLDocument+ parentElement {object} DispHTMLTableCell+ parentNode {object} DispHTMLTableCell+ parentTextEdit {object} DispHTMLBody previousSibling null IHTMLDOMNode protocol "HyperText Transfer Protocol" String readyState "uninitialized" String recordNumber null Variant+ runtimeStyle {object} DispHTMLStyle scopeName "HTML" String scrollHeight 0 Long scrollLeft 0 Long scrollTop 0 Long scrollWidth 0 Long sourceIndex 186 Long src "http://localhost/ProjectManagerBranch/GaugeImages/ProjectList1_wgb_ProjectList_wgb_Dashboard_UltraGauge3_e2b4x1umsfc0saejealcch55.png?t=128843623079367695" String Start "fileopen" String+ style {object} DispHTMLStyle tabIndex 0 Integer tagName "IMG" String tagUrn "" String title "Variance = -27.370" String uniqueID "ms__id1" String uniqueNumber 1 Long useMap "" String vrml "" String vspace 0 Long width 0 Long
Not sure if I am looking in the correct place, but here is what Firebug has on the Net tab for the gauge when it errors. This is on the Headers tab:
close
4040
text/html
Microsoft-IIS/5.1
Thu, 16 Apr 2009 14:11:53 GMT
localhost
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729)
image/png,image/*;q=0.8,*/*;q=0.5
en-us,en;q=0.5
gzip,deflate
ISO-8859-1,utf-8;q=0.7,*;q=0.7
300
keep-alive
http://localhost/ProjectManagerBranch/GeoCuePDB.aspx
ASP.NET_SessionId=nvskdp45y00yqq3rs0rvnk45; .ASPXAUTH=88AA2BA589EA1EAE36ADC67C94141E74A632EA1BBCC4427D7317C5971342577BFBCCFAE052557C2909A9787474A49B7FCB79C90EA9A10B579BAEDFC793DC60E86B9085073857AF13A097CCF593B8A29B
It shows the error as "404 Object Not Found"
hmm, and if you look on your file system, is the image file there?