How to refresh parent and ancestor windows after closing the child windows?
I have three windows: 1st - main window
2nd - child window - it's opened using window.showModalDialog from 1st widnow. 3rd - window - is an ancestor of 1st window and is's opened from 2nd window using window.showModalDialog.And now what I need开发者_开发技巧 to achieve is to open 1, 2 and 3 window. Next after closing the 3rd one, refresh the 2nd one. And after closing the 2nd one, refresh the 1st one.
But there is one more assumption, I don't want to have any post-back during this process.
Dose anybody have any idea how to make it?
The easiest solution would be to do it BEFORE you close the child windows.
window.opener.location.reload(true);
window.close();
On the page which has child, invoke a child using function which returns value when it is closing. Depending on this value let the parent refresh itself using get method. You can achieve this by changing it's current url, for example by adding some parameter to it. That's all.
For showModalDialog there got a solution now, just use __doPostBack() at the parent window works fine.
Reffral link
精彩评论