I load a pop-up window fromone of my pages and based on certain action in the pop-up I need to close the pop-up and refresh data on the parent page.
I used the functionality as shown in the demo - http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window
I was able to send back arguments to the parent page and the ajaxrequest is initiated. But as soon the page is posted back my pop-up window shows up again. If I comment the code to initiate the ajaxrequest everything looks ok.
Below is the code I am using:
On Parent Page:
function OnClientClose(args) {
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
var arg = args.argument
if (arg) {
ajaxManager.ajaxRequest("Refresh");
}
else {
}
}
Window declaration on parent page:
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
Behavior
=
"None"
ShowContentDuringLoad
=
"false"
Width
=
"900px"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"RadWindowSelectPolicyRole"
runat
=
"server"
DestroyOnClose
=
"false"
Title
=
"Activity"
OnClientClose
=
"OnClientClose"
Behavior
=
"None"
ReloadOnShow
=
"true"
ShowContentDuringLoad
=
"false"
Width
=
"975px"
Height
=
"545px"
Modal
=
"true"
/>
</
Windows
>
</
telerik:RadWindowManager
>
code-behind:
Protected Sub manager_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs)
If e.Argument = "Refresh" Then
PopulateAdditionalContacts()
End If
End Sub
on my dialog page I close the window like this:
function CloseWindowOnSuccess() {
var oWnd = GetRadWindow();
if (oWnd != null) {
oWnd.argument = "Refresh";
oWnd.close();
}
}
I am unable to understand why the pop-up window is loaded once the ajax request is initiated?