The CloseRadWindowPostback JS routine is called after the user has interacted with the form, and when an OK-type button in the form is pressed. So the resources should be fully loaded, and the only reason that this routine is called and used is to pass the user-specified results from the popup dialog back to the calling form.
This JS routine is in a JS script file that is loaded from the head tag of the Master page associated with the popup dialog. The server side logic injects JS code into the page to call this routine after the OK button processing has been done. Here is the server code:
Public Shared Sub ClosePopupPagePostback(ByVal ctlClientScriptMgr As ClientScriptManager, ByVal oPage As Object, ByVal sArgument As String)
Dim sScript As String = "<script>CloseRadWindowPostback(""%argument%"")</script>".Replace("%argument%", sArgument)
This works properly because the CloseRadWindowPostback
routine is called and then fails when trying to do the ajaxRequest call.
I should note that both the popup dialog and the calling form have instances of both the AjaxManager and the ScriptManager defined on their Master pages (NOT in the forms themselves). The popup form is created server-side via an Add Window call to a WindowManager control defined on the calling form (NOT in its Master page), as follows:
. . . (create popup logic code - this works properly)
The reference that you sent doesn't seem to make sense in this case because the AjaxManager on the popup dialog is only being used to handle the ajaxRequest call, which is not related to any control on the popup form.
I am totally open to other methods of accomplishing the same thing. If there is another way to achieve the same effect (to fire an event on the calling page with the results of the popup dialog), then let me know.