programmatically opening window reloads page

4 posts, 1 answers
  1. TSCGlobal
    TSCGlobal avatar
    43 posts
    Member since:
    Jan 2008

    Posted 11 May 2010 Link to this post

    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.
  2. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 12 May 2010 Link to this post

    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.
  3. TSCGlobal
    TSCGlobal avatar
    43 posts
    Member since:
    Jan 2008

    Posted 12 May 2010 Link to this post

    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?
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 12 May 2010 Link to this post

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