Hi,
I'm using jQuery BlockUI Plugin to show busy message when a click event is fired.
In the scenario below, it's working fine. The busy message shows and locks UI on click event, and dissapears when postback's done.
No file creation involved, which invokes browser Open/Save As dialog box
Mark-up:
$(function() { // when document has loaded
($.unblockUI); //unlock UI
//Show busy message on click event and disable UI
$('#btnDemo').click(function() {
$.blockUI({ message: '<h3>Please wait...</h3>' });
});
});
<asp:Button ID="btnDemo" runat="server" Text="Hello World" /><br/>
Code behind:
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
Now, here comes the problem. 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.
Mark-up:
$(function() { // when document has loaded
($.unblockUI); //unlock UI
//Show busy message on click event and disable UI
$('#btnCreateFile').click(function() {
$.blockUI({ message: '<h3>Please wait...</h3>' });
});
});
<asp:Button ID="btnCreateFile" runat="server" Text="Create File" /><br/>
Code-behind:
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
I want to get rid of the busy message and unlock the UI when Open/Save As dialog box appears.