Hiding Control In Master Page When in RadWindow

2 posts, 0 answers
  1. Brian Mains
    Brian Mains avatar
    485 posts
    Member since:
    Oct 2008

    Posted 07 Jun 2011 Link to this post


    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?

  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 08 Jun 2011 Link to this post

    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");
                alert("The page is loaded in the browser");

    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.

  3. DevCraft R3 2016 release webinar banner
Back to Top