This is a migrated thread and some comments may be shown as answers.

Display PDF file

3 Answers 107 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 19 Mar 2013, 12:20 PM
Hi,

How to display a PDF File in a radwindow on radbutton click?

Thank you,
Ben.

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 1
answered on 19 Mar 2013, 12:48 PM
Hi,

Please have a look into the following code.

ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <Windows>
        <telerik:RadWindow ID="RadWindow2" runat="server">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
<telerik:RadButton ID="RadButton1" runat="server" Text="Open PDF" AutoPostBack="false"
    OnClientClicked="openPdf">
</telerik:RadButton>

JavaScript:
<script type="text/javascript">
    function openPdf(sender, args) {
        window.radopen("SampleFile.pdf", "RadWindow2");
    }
</script>

Thanks,
Princy.
0
Ben
Top achievements
Rank 1
answered on 19 Mar 2013, 05:04 PM
Got it working... thank you princy. I tried the similar code without RadWindowManager but it didnt worked. Is it mandatory to use RadWindowManager to open a radwindow to display the Pdf?
0
Accepted
Princy
Top achievements
Rank 1
answered on 20 Mar 2013, 04:29 AM
Hi Ben,

Its not like RadWindowManager is necessary to open a RadWindow to display the Pdf. Since you are using the radopen() to open the RadWindow, RadWindowManager should be present on the page. This is because the RadWindowManager's client-side API is providing the radopen() function that can easy and quickly replace the standard browser's popup (window.open()).

Thanks,
Princy.
Tags
Window
Asked by
Ben
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Ben
Top achievements
Rank 1
Share this question
or