Hello,
I have a page, which opens a dialog window (Window1). In Window1 there's a custom AJAX control with button which in turn opens new dialog window (Window2). When Window2 closes, a page must handle Window2's OnClientClose event, and Window2 must pass some data to my custom control on WIndow1. To avoid stack overflow, as you adviced here, I put handler on main page.
And now I want to get data sent by Window2 and put them to my control on Window1. This is how I'm doing that now:
I have a page, which opens a dialog window (Window1). In Window1 there's a custom AJAX control with button which in turn opens new dialog window (Window2). When Window2 closes, a page must handle Window2's OnClientClose event, and Window2 must pass some data to my custom control on WIndow1. To avoid stack overflow, as you adviced here, I put handler on main page.
And now I want to get data sent by Window2 and put them to my control on Window1. This is how I'm doing that now:
function referenceWindowClose(sender, args) { sender.remove_close(referenceWindowClose); var arg = args.get_argument(); if (!arg) return; var ctl = $find(arg.TargetControlID); if (ctl == null) return; ctl.set_text(arg.Caption); ctl.set_value(arg.RefID); }Variable named ctl is my custom AJAX control. Problem is ctl is always null. I know this happens because Window1 is in IFRAME. But how do I find it from main page? Using sender parameter? Please help.