This is a migrated thread and some comments may be shown as answers.

RadAjaxLoadingPanel Won't Hide When Opening PDF

4 Answers 84 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 28 Sep 2012, 01:55 PM
On my website, I have a master page where my RadAjaxLoadingPanel resides. On my content page, I have a RadGrid where one of the template columns is an ImageButton that when clicked will read a file from my database and using the code below will allow the user to view it:

Response.Buffer = true;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.AddHeader("content-disposition", string.Format("attachment;filename={0}", "MillCert.pdf"));
Response.BinaryWrite(BinaryFile);
Response.Flush();
Response.End();

The entire RadGrid is wrapped in a RadAjaxPanel with it's ClientEvents-OnRequestStart set to cancel the Postback:

function conditionalPostback(sender, args) {
    args.set_enableAjax(false);
}

This works fine but after the PDF is opened, the RadAjaxLoadingPanel just stays on and won't hide!

I've searched through the forums and Google but nothing anyone has suggested will work.

The opening of the file is done through the OnItemCommand method of the RadGrid but I also have some custom filtering being done through there so I can't separate it out, I need it ONLY for this one item.

Any suggestions?

4 Answers, 1 is accepted

Sort by
0
Curtis
Top achievements
Rank 1
answered on 28 Sep 2012, 07:58 PM
I have the exact same issue. How can we force the AjaxLoadingPanel to hide once the postback event has finished writing out to the Response stream on the server-side? Is there any client side page event that fires? Can we register any type of Javascript to run?
0
Daniel
Telerik team
answered on 02 Oct 2012, 07:24 AM
Hi guys,

You could try the approach, demonstrated in the following code-library:
Show loading panel when exporting RadGrid

Best regards,
Daniel
the Telerik team
 
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
 
0
Sriram
Top achievements
Rank 1
answered on 31 Mar 2014, 07:53 PM
This URL does not work!!

I experience the same problem what others have written in the thread. Please share the working URL!!

Thanks,
Sriram
0
Shinu
Top achievements
Rank 2
answered on 01 Apr 2014, 06:09 AM
Hi,

Please have a look into this CodeLibrary which discuss about the same scenario.

Thanks,
Shinu.
Tags
Ajax
Asked by
Brett
Top achievements
Rank 1
Answers by
Curtis
Top achievements
Rank 1
Daniel
Telerik team
Sriram
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or