On my aspx page1, I have a button that opens a radwindow implemented on aspx page2 when clicked. Within the radwindow, I input some data and click save which triggers a server-side method before closing the radwindow. Following the closure of the radwindow, I need to execute a method on page1. How can this be accomplished?
Below is the code snippet used to open the radwindow from page1:
function btnAddNewImage_click() {
debugger;
var hdn_PatientId = document.getElementById("<%=hdn_PatientId.ClientID %>").value;
var selectedEncounterId = document.getElementById("<%=hdn_EncounterId.ClientID %>").value;
var oWnd = radopen("../Admin/Encounter/PopUps/UploadImages.aspx?EncounterId=" + selectedEncounterId + "&PatientId=" + hdn_PatientId, "rwDialog");
oWnd.SetTitle("Upload Image");
oWnd.SetSize(600, 350);
oWnd.Center();
//oWnd.add_close("refreshGrid");
oWnd.OnClientClose = "refreshGrid"; // Not working
return false;
}
Function that should trigger after the radwindow is closed:
function refreshGrid(sender, eventArgs) {
debugger;
alert("in refreshgrid");
var selectedEncounterId = document.getElementById("<%=hdn_EncounterId.ClientID %>").value;
loadImagesProgressNotes(selectedEncounterId, "Current");
}
Code snippet responsible for closing the radwindow in page2:
RadScriptManager.RegisterStartupScript(this, this.GetType(), "Alert", "javascript:returnToParent();", true);
function returnToParent() {
debugger;
//get a reference to the current RadWindow
var oWnd = GetRadWindow();
oWnd.close();
}