Display PDF file

4 posts, 2 answers
  1. Ben
    Ben avatar
    31 posts
    Member since:
    Feb 2013

    Posted 19 Mar 2013 Link to this post

    Hi,

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

    Thank you,
    Ben.
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Mar 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ben
    Ben avatar
    31 posts
    Member since:
    Feb 2013

    Posted 19 Mar 2013 Link to this post

    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?
  5. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 19 Mar 2013 Link to this post

    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.
Back to Top