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

How to Open a Pdf file in RadWindow using Javascript

2 Answers 169 Views
Window
This is a migrated thread and some comments may be shown as answers.
A2H
Top achievements
Rank 1
A2H asked on 21 Nov 2012, 12:59 PM
Hi All,
I want to open a PDF file in a  Rad Window.I have gone through some forum replies and unfortunately in almost all replies the solution is to set the below 2 properties in RadWindow.
VisibleOnPageLoad="true" ShowContentDuringLoad="true".

If I set VisibleOnPageLoad property , as name suggests when the parent page loads RadWindow will also get displayed.
My requirement is when the parant page loads,RadWindow should be hidden and when I click on a link Radwindow should open with the PDF.

RadWindow Code:
  <telerik:RadWindow ID="TestWindow" runat="server" EnableEmbeddedSkins="True" Skin="Windows7" 
                   Modal="True" Width="900" Height="500" KeepInScreenBounds="True" Overlay="True" 
                   DestroyOnClose="false" VisibleStatusbar="false" VisibleTitlebar="true" 
                    ShowContentDuringLoad="true"
                   >
                    <ContentTemplate>
                                               
                    </ContentTemplate>
                  </telerik:RadWindow>

I am opening Radwindow using javascript code

 function showRadWnd() {
                         window.radopen("RadExport.pdf", "Test");
                        return false;
        }
Please help me.

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 22 Nov 2012, 09:20 AM
Hi,

I was able to open a pdf file using the following code.
aspx:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        <Windows>
            <telerik:RadWindow ID="RadWindow2"  runat="server">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
 <asp:Button ID="Button2" runat="server" Text="open" OnClientClick="Open(); return false;" />

JS:
function Open() {
   window.radopen("RadGridExport.pdf", "RadWindow2");
}
As an alternative, you can also set the NavigateUrl property of the RadWindow.
aspx:
<telerik:RadWindow ID="RadWindow2" VisibleOnPageLoad="true" NavigateUrl="~/RadGridExport.pdf" runat="server"></telerik:RadWindow>

Thanks,
Shinu.
0
A2H
Top achievements
Rank 1
answered on 03 Dec 2012, 05:48 AM
Hi Shinu,

Setting Navigate url worked for me..

Thanks for you help

Thanks,
A2H
Tags
Window
Asked by
A2H
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
A2H
Top achievements
Rank 1
Share this question
or