I am opening the popup window with the below code from Server side
var url =
string
.Format(
"../UserPopup.aspx?user_Ids={0}&fromDate={1}&toDate={2}"
, user_Ids, fromDate, toDate);
string
script =
string
.Format(
"function f(){{openDialog('{0}', {1}, {2}, {3});Sys.Application.remove_load(f);}}Sys.Application.add_load(f);"
,
url,
"true"
,
1000,
300);
ScriptManager.RegisterStartupScript(Page, Page.GetType(),
"someKey"
, script,
true
)
Below is the code for closing the popup window from javascript. The below code is not working.
function
GetRadWindow() {
var
oWindow =
null
;
if
(window.radWindow)
oWindow = window.radWindow;
else
if
(window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
return
oWindow;
}
function
Close() {
var
result = window.confirm(
"Are you sure you want to close the window!"
);
if
(result ==
true
) {
var
oWindow = GetRadWindow();
oWindow.argument =
null
;
oWindow.onunload = refreshParent;
oWindow.close();
return
false
;
}
}
function
refreshParent() {
window.opener.location.reload();
}
How can I close the popup window from client side and refresh the parent page?
FYI: I am using RadWindow as popup for this.