469,626 Members | 880 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

How to hide loading message (displayed with jquery)

i am using jquery to display a working... div to show the user that the query is doing something.
to show....
Expand|Select|Wrap|Line Numbers
  1.      Sys.Application.add_init(function() {
  2.       $addHandler($get('ctl00_ContentPlaceHolder1_LinkButtonQuickReport'), 'click', function() {
  3.         $('#working').show();
  4.       });
  5.     });
to hide...
Expand|Select|Wrap|Line Numbers
  1.       var prm = Sys.WebForms.PageRequestManager.getInstance();
  2.       prm.add_endRequest(function() {
  3.       $('#working').hide();
  4.     });
this works fine when the data is displayed in the gridview. but the user has the option to automatically start a download if the dataset has more than x rows.
the function zips the results to a file and then uses response.transmitefile to start the download. the problem is that the endrequest is never kicked off because of the download, so i am left with the loading message still displayed on the screen. a refresh takes care of it but then all the options set on the page go back to default plus that is just annoying :-).
how do i remove the working div when the user gets an automatic download?
is there a better way to display a working msg than this? i was using updateprogress with updatepanel around the gridview but the response.transmitefile doesnt work.
any help is greatly appreciated
Aug 31 '09 #1
3 3733
9,735 Expert Mod 8TB
The reason your not hitting the end request is because you're not sending back HTML to the browser...so Ajax can't do it's thing to update the portion of the page that needs to be updated.

What I recommend is preparing the zip file when you make the Ajax request and upon returning (in the end request) set a hidden iFrame's source to another ASPX page that will use the Response.TransmitFile() to send the file to the browser. (This means that you'll have to create another ASPX page that will simply return the prepared zip file.)

Sep 1 '09 #2
works great thanks a bunch.
Sep 2 '09 #3
9,735 Expert Mod 8TB
Awesome :) Glad it worked for you :)

Sep 2 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

13 posts views Thread by Matt | last post: by
1 post views Thread by Heinz K | last post: by
53 posts views Thread by souporpower | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.