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

How to use jQuery dialog instead of Radwindow

2 Answers 170 Views
Window
This is a migrated thread and some comments may be shown as answers.
Iuzzef
Top achievements
Rank 1
Iuzzef asked on 13 Mar 2013, 01:12 AM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Mar 2013, 07:37 AM
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.
0
Iuzzef
Top achievements
Rank 1
answered on 14 Mar 2013, 12:21 AM
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
Tags
Window
Asked by
Iuzzef
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Iuzzef
Top achievements
Rank 1
Share this question
or