I got one classic asp page and another aspx page. The classic asp page will be the parent page and the aspx page will be the child page. The child page will have a code behind page that update or add the data. The changes after any operation (update/add) will be reflected immediately at the parent page, after the child close via window.close().
I have tried to set hidden variable at the parent page and set the hidden variable at the child page and put it at body onunload event, but it seems not working.
My classic asp page:
if Request.Form="" then
if Request.Form("hidMode") = "Cr" and Request.Form("hidECardID") <> "" then
SuccessMsg = "The ECard ID template is successfully created."
end if
end if
At end of classic asp page (before form tag closing):
<input type="hidden" name="hidMode">
<input type="hidden" name="hidECardID">
My aspx page:
inside head tag:
<script type="text/javascript">
function passVal() {
winObj = window.opener
//alert(window.opener.location.href) //doesn't produce popup
eCardID =<%=hdECardID.Value%>
docMode =<%=hdMode1.Value%>
winObj.document.form1.hidECardID.value = eCardID;
winObj.document.form1.hidMode.value = docMode;
window.opener.document.form1.submit();
window.close()
}
</script>
At body tag:
<body onunload="passVal()">
I've search for answer but mostly is aspx to aspx page. I could use response.redirect, but my issue is this aspx is a pop-up (not an iframe), after user clicked on a button on the classic asp page. Using response.redirect will only open the page inside the pop-up itself, and not refreshing the parent page.