How to close download window

4 posts, 0 answers
  1. Adam
    Adam avatar
    9 posts
    Member since:
    Nov 2008

    Posted 15 Sep 2009 Link to this post

    When I double-click on a file to download it, an empty RadWindow appears.  How to I either prevent this from appearing, or close if after the download begins/finishes?

    Thanks,
    Ada,
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 16 Sep 2009 Link to this post

    If you take a look at this demo it shows how to force direct downloading - which should take care of the RadWindow problem. It would seem that this javascript is what handles everything when you have defined the onclientfileopen event.

    function OnClientFileOpen(oExplorer, args) 
       var item = args.get_item(); 
       args.set_cancel(true); //this prevents the window from opening 
       var docLoc = "Handler.ashx?path=" + item.get_url(); 
       document.location = docLoc; 

    That function is just a re-write of the one provided in the demo with all of the checking removed. It will force a download as well so perhaps you just need to use the args.set_cancel(true); line depending on your implementation.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Adam
    Adam avatar
    9 posts
    Member since:
    Nov 2008

    Posted 16 Sep 2009 Link to this post

    Thanks, that worked!
  5. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 17 Sep 2009 Link to this post

    Hi Adam,

    In addition to what Carl wrote, I'd like to add that the RadFileExplorer features a property (true by default) -
    EnableOpenFile (on doubleclick). You can examine the way it behaves in the default demo:
    http://demos.telerik.com/aspnet-ajax/fileexplorer/examples/default/defaultcs.aspx

    One thing you could do - other than using the provided JavaScript - is set this property to false.

    Best regards,
    Tervel
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top