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

Hiding Control In Master Page When in RadWindow

1 Answer 45 Views
Window
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 07 Jun 2011, 09:14 PM
Hello,

I have a control in a master page that I want to display only when the master page is not in a RadWindow; when in a RadWindow, it should be hidden.  Is that possible to do, to detect when the page request is inside the RadWindow?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 08 Jun 2011, 12:38 PM
Hello Brian,

Such check can be done on the client only - there isn't a server-side method that would detect how the HTML is rendered - in the topmost page or in some container like IFRAME.
To detect on the client if a page is loaded in a RadWindow, you could use a slightly modified version of the GetRadWindow() function:

<script type="text/javascript">
    function GetRadWindow()
    {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement && window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
        return oWindow;
    }
 
    function CheckWnd()
    {
        var wnd = GetRadWindow();
        if (wnd)
        {                                        
            alert("This page is loaded in a RadWindow");
        }
        else
        {
            alert("The page is loaded in the browser");
        }
    }
</script>


Kind regards,
Georgi Tunev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Window
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or