Refresh parent window from child window without having to press the refresh button

Ref: http://www.dotnetjunkies.com/WebLog/dinakar/articles/12379.aspx

 

  • Heres a small piece of code to force refresh the parent window from the child window after closing the child window, without having to press the refresh button.
window.opener.location=window.opener.location; window.close();

response.write the above JS code in the child window.

for example:

response.write(”<Script> window.opener...........close();" & Chr(60) & "/script >")

  • If you want the user to manually refresh the page after closing the child window use

    window.opener.location.reload();window.close();

    in the above example.

  • If you just want to close the child window ( as in “cancel”) use window.close(); in the above example.
posted @ 2008-04-14 10:50  Vincent Yang  阅读(570)  评论(0编辑  收藏  举报