Working in ASP.NET. I have a main page with an iFrame inside it. The main page lists payor names, the iFrame lists the details of the selected payor. On the iFrame page I have a link button that launches a modal dialog window and allows the user to copy an existing payor to a new payor. When I close the modal dialog window I want to refresh the main page to include the newly added payor.
I read this: asp.net Refresh base page from iframe
but it is not working for me.
My iFrame aspx page has the following:
function RefreshParent() {
window.parent.location.href = window.parent.location.href;
}
The iFrame code-behind page has the following in the Page_Load:
ClientScript.RegisterStartupScript(Me.GetType, "RefreshParent", "<script type=text/javascript>RefreshParent();</script>", True)
When I close the modal dialog window the parent page is NOT refreshed, but this appears in the bottom left of the screen, under the iFrame page:
//]]>
The RegisterStartupScript only happens under certain conditions, but I’ve stepped through it in debug and confirmed those conditions are met, and that line of code is executing.
Any help would be much appreciated.
Figured it out. I had to change the code-behind page to this:
Now the screen refreshes correctly and the //]]> does not appear.