RadWindow could not close on download button.

7 posts, 0 answers
  1. Sushobhit
    Sushobhit avatar
    26 posts
    Member since:
    Apr 2011

    Posted 21 Jun 2012 Link to this post


    I have open a RadWindow on a button click event and then in that window i have added a download button for downloading the file.
    But as the download pop up the radwindow stop behaving. Right now i want that RadWindow should get close automatically  when the download gets completed but currently it remains open. So please provide me solution for this.

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Jun 2012 Link to this post

    Hi Sushobhit,

    Try the following code snippet to close the RadWindow.

    <asp:Button runat="server" ID="btnDownLoad" Text="DownLoad" OnClientClick="CloseDialog();return false;" OnClick="btnDownLoad_Click" />

    <script type="text/javascript">
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;
            function CloseDialog() {
                __doPostBack("<%=btnDownLoad.UniqueID %>", "");

    Hope this helps.

  3. Sushobhit
    Sushobhit avatar
    26 posts
    Member since:
    Apr 2011

    Posted 21 Jun 2012 Link to this post

    Hi Princy

    Thanks for your reply.
    but after using this onclientclick on Download button the radwindow gets close before the download begins.
    Please tell me any other solution so that user can download and radwindow gets close after that.

  4. Marin Bratanov
    Marin Bratanov avatar
    4811 posts

    Posted 22 Jun 2012 Link to this post


    There simply isn't a browser event that you can hook to when the download finishes, begins, or is ongoing. This means there isn't an event that you can use to close the RadWIndow (or a regular browser window, for that matter) when the download is done. What you can do is to redirect the main page and not send the file as an inline attachement as this makes it more probable that the browser will display the download prompt in the same window without opening a new one (either a RadWIndow or browser window).

    Kind regards,
    Marin Bratanov
    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.
  5. Sushobhit
    Sushobhit avatar
    26 posts
    Member since:
    Apr 2011

    Posted 14 Aug 2012 Link to this post

    Hi Princy

     Thanks of lot i have fixed the problem with your code and some modification . 

  6. Amruta
    Amruta avatar
    18 posts
    Member since:
    Apr 2009

    Posted 20 May 2015 Link to this post

    Hi Sushobhit,

    Can you please post your code for the same. I have same kind of requirement.



  7. Logan
    Logan avatar
    29 posts
    Member since:
    Jan 2012

    Posted 30 Sep 2016 in reply to Sushobhit Link to this post

    Still having this issue, any thoughts?
Back to Top