Javascript Error with ProgressBar

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Javascript Error with ProgressBar

Guest-1119
Hi Dean, I am using an inline progress bar inside a standard Ajax modalpopupextender. It works just fine, except that I am getting a Javascript error, which I'd like to get rid of. My code is this: The Javascript error is occurring on the line "var origDisplay = inlineProgressBar.Display;" and the error is "'Display' is null or not an object". I am using IE8 on Windows 7; the application is running on Windows Server 2008/IIS7. The progressbar control is NOT inside an updatepanel, just in a modalpopupextender. Could you help me troubleshoot this error? Thank you! Sincerely, Amy
Reply | Threaded
Open this post in threaded view
|

Re: Javascript Error with ProgressBar

Guest-1119
Hi Dean, I have just seen another thread regarding the same error. I tried changing the Javascript control id to match what I have, and it still errs on the same line. My code is now this: I have also tried incorporating the code from demo.aspx as-is, simply copying the code from demo.aspx to my page:
and it still gives the error on the same line. Any suggestions? Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Javascript Error with ProgressBar

Guest-1119
Hmm, I guess the forum software doesn't like embedded HTML/Javascript. Let's try again with this: This is the code that I have that errs: upload:progressbar id="pbUploadFile" runat="server" inline="true" triggers="btnUploadFile" visible="true" cssclass="progressBar" width="450px" /> script type="text/javascript"> window.onload = function() { var inlineProgressBar = NeatUploadPB.prototype.Bars["pbUploadFile"]; var origDisplay = inlineProgressBar.Display; inlineProgressBar.Display = function() { var elem = document.getElementById(this.ClientID); elem.parentNode.style.display = "block"; origDisplay.call(this); } inlineProgressBar.EvalOnClose = "NeatUploadMainWindow.document.getElementById('" + inlineProgressBar.ClientID + "').parentNode.style.display = \"none\";"; } /script> Also, here is the code I used directly from demo.aspx: div style="display: none;"> Upload:ProgressBar id="inlineProgressBar" runat="server" inline="true" Triggers="submitButton linkButton commandButton htmlInputButtonButton htmlInputButtonSubmit" /> /div> script type="text/javascript"> window.onload = function() { var inlineProgressBar = NeatUploadPB.prototype.Bars["inlineProgressBar"]; var origDisplay = inlineProgressBar.Display; inlineProgressBar.Display = function() { var elem = document.getElementById(this.ClientID); elem.parentNode.style.display = "block"; origDisplay.call(this); } inlineProgressBar.EvalOnClose = "NeatUploadMainWindow.document.getElementById('" + inlineProgressBar.ClientID + "').parentNode.style.display = \"none\";"; } /script> Amy
Reply | Threaded
Open this post in threaded view
|

Re: Javascript Error with ProgressBar

Dean Brettle
Administrator
Note that the string used to index into the Bars[] array needs to be the ClientID of the ProgressBar control.  This can be different than the id attribute of the control if, for example, the ProgressBar is in user control.  To determine the ClientID you can either use a debugger or check the id attribute in the rendered HTML instead of the aspx file.
Reply | Threaded
Open this post in threaded view
|

Re: Javascript Error with ProgressBar

Guest-1119
Hi Dean, Thank you so much, that was indeed the issue! Sincerely, Amy