RadAjaxLoadingPanel remains visible after file downloaded to browser

5 posts, 0 answers
  1. jlj30
    jlj30 avatar
    102 posts
    Member since:
    Jan 2011

    Posted 12 Dec 2012 Link to this post


    I have a master page with a RadAjaxPanel wrapped around the ContentPlaceHolder.
    This works well for most of my pages with the RadAjaxLoadingPanel popping up as expected and disappearing when the request completes.

    My issue occurs when I download a file to the browser using the following sequence of code: (*** Code updated 13dec2012 ***)

    Response.TransmitFile(path + Session["Attachment"].ToString());
    Response.AddHeader("Content-Disposition", "attachment; filename=" + Session["Attachment"].ToString().Replace(" ", "_"));
    Response.ContentType = "application/octet-stream";

    The above code is actually in a separate page from the one on which the initial request was launched.  I do a Response.Redirect to get to this second page (which is not displayed, but just performs the above code in its Page_Load event).

    The document is successfully downloaded to the browser, but the RadAjaxLoadingPanel remains visible.
    Is there something I should be doing to make the loading panel aware that the request is complete?
    I have tried using Response.End() but this causes an error.

    Once again, the loading panel is working fine for any other type of requests; it's only the document download that causes the problem.

    Any suggestions would be greatly appreciated.

    Thanks in advance.

  2. Angel Petrov
    Angel Petrov avatar
    1044 posts

    Posted 17 Dec 2012 Link to this post

    Hi Jim,

    The downloading scenario described is not supported by the MS Ajax framework. Please review the following help articles which describe how to download files and redirect to another page with RadAjax:


    All the best,
    Angel Petrov
    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.
  3. jlj30
    jlj30 avatar
    102 posts
    Member since:
    Jan 2011

    Posted 18 Dec 2012 Link to this post


    Thanks for your suggestions.
    The RadAjaxPanel1.ResponseScripts.Add(...) solution (identified in your first link) worked for me.
    I call this when I have completed building the document to be downloaded.
    This causes the loading panel to disappear and the browser notifies me that I have a file to save/open just a second or two later.
    The redirected page (in my case ViewAttachments) performs the actual TransmitFile.

    MstrPanel1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", "ViewAttachments.aspx?Path=ExternalDocs&Delete=No"));

    Thanks again.

  4. Kishan
    Kishan avatar
    4 posts
    Member since:
    Mar 2015

    Posted 05 Jun 2015 Link to this post


    I have a one imagebutton inside telerik radgrid control when i click on image getting the image path and download the file.

    I use the same above code in my page. But file not downloaded. 

     RadAjaxPanel1.ResponseScripts.Add(String.Format(@"window.location.href = ""{0}"";", "http://localhost:89/images/Logs/test.tif"));

    event occurs successfully but file not downloaded?

     is there any ajax effect to restrict the download in telerik:RadAjaxpanel?

    Please give the proper and quick solution for this its very urgent for me to download functionality.

    I already searching too much but not getting solution.

     Thanks & Regards

     Kishan Prajapati




  5. Angel Petrov
    Angel Petrov avatar
    1044 posts

    Posted 09 Jun 2015 Link to this post

    Hi Kishan,

    In attachments you can find a sample web site which illustrates a possible realization of the targeted scenario. Hope the provided sample helps you achieve the desired goal.

    Angel Petrov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top