views:

836

answers:

1

window.opener.location.reload(); is working fine with IE but not refreshing parent page in mozilla firefox browser.. please tell me how to refresh parent page in cross browser.

i have got this function :

   Shared Sub CloseMyWindow()
    Dim tmpStr As String = ""
    tmpStr += "window.open('','_parent','');window.close();"
               tmpStr += "window.opener.location.reload();"

    'Dim currentPage As Page = TryCast(HttpContext.Current.Handler, Page)
    'currentPage.ClientScript.RegisterStartupScript(GetType(me), "refresh", tmpStr, True)
    HttpContext.Current.Response.Write("<script language='javascript'>" + tmpStr + "</script>")
    HttpContext.Current.Response.End()
End Sub
+1  A: 

Check out this tutorial and maybe try an alternative ways to refresh the page (just to be sure ;)) like

window.opener.location.href = window.opener.location.href

as the reload way seems not to work in Firefox (actually the opener property should)

Try to install Firebug or some other diagnostic tool to see whether the opener property is not null and better understand the problem. Firebug is awesome anyway :)

Thomas Wanner
good tutorial but neither solution nor hint is their...
Rajesh Rolen- DotNet Developer
It's just an alternative way to the usage of opener that you might want to try if the opener property is the problem. It could be the reload function or anything else.. you never know ;)
Thomas Wanner