How to use jQuery dialog instead of Radwindow

3 posts, 0 answers
  1. Iuzzef
    Iuzzef avatar
    2 posts
    Member since:
    Mar 2013

    Posted 12 Mar 2013 Link to this post

    I need to change a function in our company software that uses Radwindow so it uses jQuery ui dilog instead (for reasons beyond me).
    function ShowPopupByWindow(_type, _targetControl, _radWindow) {
      var popupURL = 'finder.aspx?action=' + _type;
      
      // This is how the Radopen is working right now
      //var oWnd = window.radopen(popupURL, _radWindow);
       
      // This is what I want to implement
      selector = "#" + _targetControl;
      jQuery(selector).dialog({ modal : true, open:
        function () {
          $(this).load(popupURL);
        }
      });
    }


    however i get this error Uncaught TypeError: Cannot set property 'control' of undefined
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Mar 2013 Link to this post

    Hello,

    Please check the following code that display a jQuery dialog on button click and load a page inside the dialog.

    ASPX:
    <head runat="server">
        <title></title>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <asp:Button ID="btnOpenMe" runat="server" Text="Click Me to open Dialog box" />
            <div id="dialog" title="My Dialog Title">
            </div>
        </div>
        </form>
    </body>

    JavaScript:
    <script type="text/javascript">
        $(document).ready(function () {
            $("#dialog").dialog({ autoOpen: false });
     
            $("#<%=btnOpenMe.ClientID%>").click(
                function () {
                    $("#dialog").load('Default.aspx');
                    $("#dialog").dialog('open');
                    return false;
                }
            );
        });
    </script>

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Iuzzef
    Iuzzef avatar
    2 posts
    Member since:
    Mar 2013

    Posted 13 Mar 2013 Link to this post

    Yes, I also used jQuery load() and then the dialog(),
    However in any way I try to load that content with jQuery i get this error 
    Uncaught TypeError: Cannot set property 'control' of undefined
    So maybe I could load the page inside a div, with ajax in asp...
    please advice
Back to Top