Hi,
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.
Thanks
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.
Thanks
6 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 21 Jun 2012, 09:29 AM
Hi Sushobhit
Try the following code snippet to close the RadWindow.
ASPX:
JS:
Hope this helps.
Thanks,
Princy.
,
Try the following code snippet to close the RadWindow.
ASPX:
<
asp:Button
runat
=
"server"
ID
=
"btnDownLoad"
Text
=
"DownLoad"
OnClientClick
=
"CloseDialog();return false;"
OnClick
=
"btnDownLoad_Click"
/>
JS:
<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() {
GetRadWindow().close();
__doPostBack(
"<%=btnDownLoad.UniqueID %>"
,
""
);
}
</script>
Hope this helps.
Thanks,
Princy.
0
Sushobhit
Top achievements
Rank 2
answered on 21 Jun 2012, 10:46 AM
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.
Thanks
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.
Thanks
0
Hello,
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
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.
0
0
Amruta
Top achievements
Rank 1
answered on 20 May 2015, 10:28 AM
Hi Sushobhit,
Can you please post your code for the same. I have same kind of requirement.
Thanks.
0
Logan Marshall
Top achievements
Rank 2
Iron
answered on 30 Sep 2016, 06:55 PM
Still having this issue, any thoughts?