Note that there are some explanatory texts on larger screens.

plurals
  1. POUnlock UI with jQuery BlockUI Plugin after the Open/Save As dialog box appears
    primarykey
    data
    text
    <p>I'm using <a href="http://malsup.com/jquery/block/" rel="nofollow noreferrer">jQuery BlockUI Plugin</a> to show busy message when a click event is fired.</p> <p>In the scenario below, it's working fine. The busy message shows and locks UI on click event, and dissapears when postback's done.</p> <p>No file creation involved, which invokes browser Open/Save As dialog box</p> <p>Mark-up:</p> <pre><code>$(function() { // when document has loaded ($.unblockUI); //unlock UI //Show busy message on click event and disable UI $('#btnDemo').click(function() { $.blockUI({ message: '&lt;h3&gt;Please wait...&lt;/h3&gt;' }); }); }); &lt;asp:Button ID="btnDemo" runat="server" Text="Hello World" /&gt;&lt;br/&gt; </code></pre> <p></p> <p>Code behind:</p> <pre><code> Protected Sub btnDemo_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnDemo.Click Label1.Text = "Hello World" Threading.Thread.Sleep(6000) End Sub </code></pre> <p><strong>Now, here comes the problem</strong>. There's file creation involved and it invokes browser Open/Save As dialog box. The busy message shows and locks UI on click event, but doesn't dissapear and unlock UI when postback's done and user saves file.</p> <p>Mark-up:</p> <pre><code>$(function() { // when document has loaded ($.unblockUI); //unlock UI //Show busy message on click event and disable UI $('#btnCreateFile').click(function() { $.blockUI({ message: '&lt;h3&gt;Please wait...&lt;/h3&gt;' }); }); }); &lt;asp:Button ID="btnCreateFile" runat="server" Text="Create File" /&gt;&lt;br/&gt; </code></pre> <p>Code-behind:</p> <pre><code> Protected Sub btnCreateFile_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnCreateFile.Click Dim filename As String = "demo.xls" Response.ContentType = "application/vnd.ms-excel" Response.AddHeader("Content-Disposition", String.Format("attachment;filename={0}", filename)) Response.Clear() Response.[End]() End Sub </code></pre> <p>I want to get rid of the busy message and unlock the UI when Open/Save As dialog box appears.</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.
    1. This table or related slice is empty.
    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