how to prevent a radwindow from opening twice from the same link

4 posts, 0 answers
  1. Jerry
    Jerry avatar
    43 posts
    Member since:
    Mar 2012

    Posted 07 Aug 2014 Link to this post

    I have a page that has links to pop up help documents in a radwindow.  The issue I want to resolve is if a user clicks a link more then one time I don't want multiple radwindows with the same help information.  Is there a way to prevent the same link from opening multiple times?

    Here is the code i'm using to load the radwindow

      <script type="text/javascript">
        function GetRadWindow() {
          var oWindow = null; if (window.radWindow)
            oWindow = window.radWindow; else if (window.frameElement.radWindow)
              oWindow = window.frameElement.radWindow; return oWindow;
        }

        function radWin(myurl)
        {
          var oManager = GetRadWindow().get_windowManager();
          setTimeout(function () {
            oManager.open(myurl);
          }, 0);
        }
      </script>

    Part of datagrid
    <ItemTemplate>
        <%# DataBinder.Eval(Container.DataItem,"Path")%><a href="javascript:radWin('../temp.aspx?ID=<%# DataBinder.Eval(Container.DataItem,"ID")%>')"><img src='../Images/Info.gif' border=0 alt="" /></a>
    </ItemTemplate>

    Thank you
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Aug 2014 in reply to Jerry Link to this post

    Hi Jerry,

    In order to open a page in RadWindow please try to use the radopen method and also include RadWindowManager in ASPX page.

    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>

    JavaScript:
    function radWin(myurl) {
        radopen(myurl);
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jerry
    Jerry avatar
    43 posts
    Member since:
    Mar 2012

    Posted 11 Aug 2014 in reply to Shinu Link to this post

    Hi Shinu,

    Thank you for your reply.  When I use radopen it opens the radwindow within another radwindow.  That is fine but I want to prevent the same link opening in two radwindows.  Say I have a link to www.yahoo.com and when I click on it a radwindow opens with yahoo.com.  Then I click the original link again I don't want a second window of yahoo.com to open I just one the first one to stay open.  Is there a way to check what url the open radwindows have?

    Thank you,
    Jerry
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Aug 2014 in reply to Jerry Link to this post

    Hi Jerry,

    Please try to set the Modal property of RadWindowManager to true to achieve your scenario. The Modal Popup feature of RadWindow creates a semi-transparend background behind the popup that hides the rest of the page so that the user cannot interact with the page until the modal dialog is closed.

    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Modal="true">
    </telerik:RadWindowManager>

    Thanks,
    Shinu.
Back to Top