admin管理员组

文章数量:1415145

I have an ASP.NET page that contains an tag which opens a modal dialog. This modal dialog contains a control that contains a button which saves some data and closes the modal dialog. How to refresh the parent page that button is clicked?

I have an ASP.NET page that contains an tag which opens a modal dialog. This modal dialog contains a control that contains a button which saves some data and closes the modal dialog. How to refresh the parent page that button is clicked?

Share Improve this question asked Mar 20, 2014 at 9:13 3bdalla3bdalla 4071 gold badge10 silver badges29 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 1

You can run this javascript line from the modal:

window.top.location.reload();

or

parent.location.reload();

If you do not have access to the modal, you can set a handler for the close as

ModalObject.onbeforeunload = function () {
  window.top.location.reload();
};

where ModalObject is the handler that you have when you creates it.

本文标签: javascriptHow to refresh parent page after modal dialog is closedStack Overflow