ASP.NET File Upload Progress - Knowledge Base

« Back to Knowledge Base list

Javascript and StatusPanel

Q:

I'm generating some javascript after the file is being saved on postback (using RegisterClientScriptBlock), but the javascript doesn't seem to be able to see ANY controls on the page. Is there something about the StatusPanel or browser that would not allow any HTML controls to be seen from javascript generated from a postback?

A:

The StatusPanel control uses a temporary iframe for the server’s response processing.
So you should refer to the top window in your generated javascript code (not the current window).
Instead of
        document.getElementById("someMyControlID")…
use
        top.document.getElementById("someMyControlID")…