I have a button that is generating a PDF file on the server and then setting the response header information to the client for the file to be downloaded.
I would like to display a “Please Wait…” message during the postback because it could be time intensive. I’m able to display a div with no problem when the button is clicked but I’m not able to hide this div when the server returns the information.
Below is my server side code:
Response.Buffer = true;
Response.Charset = "";
Response.AddHeader("content-disposition", "attachment; filename=" + Casefile.SerialCode + ".ppt");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(binaryData);
Response.Flush();
Response.End();
I’ve tried the following Jquery to hide my Div but it never gets called…
$(document).onLoad(function ()
{
$('#divLoading').css("display", "none");
});
I do the exact same thing with this:
EDIT
You can try using the clientscriptmanager on your server side.
ClientScriptManager.RegisterStartupScript(this.GetType(), "HideDiv", "$('#inProgress').hide();", true)alternatively you can try something like:(in your javascript)