Note that there are some explanatory texts on larger screens.

plurals
  1. POUnblock (jQuery BlockUI) after file sent to browser through response stream
    primarykey
    data
    text
    <p>I have an <code>&lt;asp:button /&gt;</code> that generates a PDF report. I want to use jQuery BlockUI to display a message that says: Generating Report..</p> <p>Using: <code>Response.BinaryWrite</code> I am then sending the file to the user so it appears as a file download in the browser.</p> <p>I cannot get <code>$.unblockUI();</code> to fire. As soon as the file download begins or has completed or is cancelled I want it to dissappear. Currently it never does.. It's as though the page hasn't been re-loaded, I've hit the server but it comes back with the same page.</p> <p>Things I have tried:</p> <ul> <li>Setting a variable in JS to true so on <code>document.ready()</code> it will call a function if set to true. This doesn't work because even though I change the variable in code it doesn't change the HTML that is sent to the client.</li> <li>This sort of thing: <code>Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function() { $.unblockUI; }); //register with Microsoft way $(document).ajaxStop($.unblockUI); //double the insurance and register with jquery way</code> never gets called..</li> </ul> <p>Can this be achieved with an updatepanel?</p> <p>Any thoughts?</p> <p>Also in case it helps:</p> <pre><code>Response.AddHeader("Content-Disposition", "attachment;filename=""" &amp; ShortFilename &amp; """") Response.AddHeader("Content-Length", byteArray.Length) Response.BinaryWrite(byteArray) Response.Flush() Response.End() </code></pre> <p>I can see why this doesn't work sort of, the page is not refreshing in anyway there's just a response stream being sent to the browser, but surely there's an event I can latch on to?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload