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

programmatically opening window reloads page

3 Answers 43 Views
Window
This is a migrated thread and some comments may be shown as answers.
TSCGlobal
Top achievements
Rank 1
TSCGlobal asked on 11 May 2010, 03:04 PM
I have a bit of a puzzle.  I'm using RadWindow to open a window to another site for the purposes of tracking a package (UPS or FEDEX).  As a result, the VisibleOnPageLoad parameter is set to false initially, because the URL must be built dynamically based upon the package the user chooses to track (if it CAN be tracked).

Everything works fine up until the point that I actually set TrackWindow.VisibleOnPageLoad = True, at which point  the window opens, the URL begins to load, and then the entire PAGE goes to the URL.  This, obviously, is not the way it was meant to work, lol.  I'm thinking it is just something simple I am overlooking.  Hopefully someone can take a look and tell me what's going on, and how to fix it.

Here's the relevant .aspx code;
<!-- Windows Begin --> 
<telerik:RadWindowManager ID="TrackWindowManager" runat="server" ShowContentDuringLoad="False">  
    <Windows> 
        <telerik:RadWindow runat="server" ID="TrackWindow" VisibleOnPageLoad="false" Title="Help - Datagrid"   
            Width="500" Height="500"></telerik:RadWindow> 
    </Windows> 
</telerik:RadWindowManager> 
<!-- Windows End --> 
And here's the vb.net code behind:
    Private Sub rgPoOrders_SelectedIndexChanged(ByVal sender As ObjectByVal e As System.EventArgs) Handles rgPoOrders.SelectedIndexChanged  
 
        Dim TrackNum As String 
        Dim TrackURL As String 
        Dim TrackPack As New PackageTrack  
        Dim selectedItem As GridDataItem = rgPoOrders.SelectedItems(0)  
 
        'Get tracking number and pass to function  
        TrackNum = selectedItem(rgPoOrders.MasterTableView.Columns(2)).Text  
 
        'Get URL to track package  
        TrackURL = TrackPack.Track(TrackNum)  
        TrackWindow.NavigateUrl = TrackURL  
        TrackWindow.VisibleOnPageLoad = True 
 
        'New Code for popup, if Rad Window doesn't work;  
        'Change return value of PackageTrack to JavaCommand instead of TrackURL  
        'Response.Write(JavaCommand)  
 
    End Sub 

Note: I'd prefer NOT to add the window dynamically, unless I absolutely have to.

3 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 12 May 2010, 02:36 PM
Hello beemer,

What is the pagte that you load in the RadWindow? I assume that this is external (UPS / FedEx's) one. If this is so, this page most probably has a "frame buster" code that makes sure that this page would always be opened directly in the browser and not in an IFRAME (RadWindow is basically an IFRAME).
Here is an example of such script:
if (window != window.top) window.top.location.href = window.location.href;
As you can see, the logic that is used is quite simple - if the document is not displayed as topmost (e.g. directly in the browser) - >load the content page as topmost.



Greetings,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
TSCGlobal
Top achievements
Rank 1
answered on 12 May 2010, 02:48 PM
Ok...so are you saying there's no way to counter this, and that the way I was doing it previously (the java window.open) is probably the best way to go?
0
Georgi Tunev
Telerik team
answered on 12 May 2010, 02:53 PM
Hi beemer,

If this is indeed the case - yes, there is no workaround (otherwise it would be a major security hole). You can verify if this is the case by opening the content page not in a RadWindow, but in a standard IFRAME - if the content page loads as topmost again, then there is a framebuster script on that page for sure.



Greetings,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Window
Asked by
TSCGlobal
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
TSCGlobal
Top achievements
Rank 1
Share this question
or