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

where am i ? (in rad window or not)

4 Answers 47 Views
Window
This is a migrated thread and some comments may be shown as answers.
ehsan
Top achievements
Rank 1
ehsan asked on 21 Jul 2009, 09:52 AM
hi telerik
i want to my page knows that   opened in rad window (radwindow is its container)  or opening outside by typing url?
In other words i want to users cannot open pages instantly (prevent open outside of ranwindow)
 and be forced to view only via radwindow .
is it possible?

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 21 Jul 2009, 11:01 AM
Hi Š•hsan,

You can check if the content page is opened in an IFRAME (RadWindow is basically an IFRAME) and if not - to change the Url to the main page of the site (or wherever you want to transfer the user).
e.g.
<body onload="checkIfInRadWindow()"
    <form id="form1" runat="server"
 
    <script type="text/javascript"
        function checkIfInRadWindow() 
        { 
 
            if (!window.frameElement) 
            { 
                alert("This page is not opened in RadWindow.\n You will be returned to the main page"); 
                window.location.href = "Default.aspx"
            } 
 
        } 
    </script> 
 
    Dialog page 
    </form> 
</body> 


Regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Georgi Tunev
Telerik team
answered on 21 Jul 2009, 11:04 AM
Hi Ehsan,

Just a quick followup - you could also check the solution suggested by Petya here.

Regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
ehsan
Top achievements
Rank 1
answered on 22 Jul 2009, 02:56 AM
thank u Georgi
ur answer solved my problem ;) ,
but do u know way to check it in code behind?(not with client side script)
0
Accepted
Georgi Tunev
Telerik team
answered on 22 Jul 2009, 09:45 AM
Hello Ehsan,

This check cannot be done directly on the server - it can be executed on the client only. If you want to get the result on the server after that, you should use __doPostBack() or ajaxRequest() or some other way to post the information to the server.

Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
ehsan
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
ehsan
Top achievements
Rank 1
Share this question
or