I've encountered this issue before, but I'm having trouble figuring it out.
In my .aspx file, there is a function in the onunload body tag that refreshes the parent page.
Now, I need to determine if the page has been refreshed or reloaded because the logic will call the function every time and close my "child" page.
Here is the code snippet:
<script type="text/javascript">
function refreshparent(){
window.opener.location.reload(true);
window.close();
}
</script>
This is what I would like to achieve:
<script type="text/javascript">
function refreshparent(){
if(page.wasclosed){
window.opener.location.reload(true);
window.close();
}else{
//do nothing
}
}
</script>