This is a migrated thread and some comments may be shown as answers.
Closing a radwindow which has generated a non-HTML content to response stream
1 Answer 20 Views
This is a migrated thread and some comments may be shown as answers.
Deepak Vasudevan
Top achievements
Rank 2
Deepak Vasudevan asked on 01 Jun 2012, 02:45 PM
I have a page and clicking of a button opens a small RadWindow. Here the user makes some selections and clicks 'Generate' button. Now the server will start to stream a PDF file. Now radWindow.VisibleOnPageLoad = false does not work because the response stream is now PDF and not normal content type text/html

Is there a way to close the RadWindow in this case or is it a bug/limitation with Telerik RadWindow? 

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 05 Jun 2012, 10:52 AM
Hello Deepak,

This is neither a bug, nor a limitation of the control, but the general way things work when you change the response stream. You can no longer inject a JavaScript function from the code-behind of the page loaded in the RadWindow to close it because you no longer have a page inside. What you have is the browser's PDF plugin in case it is configured to show the pdf in place. The only way to go around this would be to store the pdf file on the server as a file, save a link to it and while you still have the page loaded inject a script instead of change the reponse. The script will 1) close the RadWIndow and 2) navigate the page to the URL passed from the server. Once the RadWIndow is closed it will not be visible yet its iframe is still active on the page (unless you have the DestroyOnClose property set to true, in this case you will get an error). Note that in this way how the user sees things depends on their machine - if it is configured to show the pdf inline and not show a download/save as box the user will not see the pdf at all. This is also the case with a browser popup. If you are capable of calling a script that will close a browser popup after you've shown a pdf inside the same logic can be used to close the RadWindow.


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.
Asked by
Deepak Vasudevan
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or