views:

418

answers:

2

Hi all,

I have a page showing all products in a gridview. I have a link in the page clicking on it opens a modal window. In the modal window there is a form to enter product and save. When I fill the form and save product I need to make the parent page to be refreshed so that the new product is listed in the gridview and a message will be shown in a label in the modal window. I need to refresh the product list page without closing the modal window. How to do it?

Please help.

+2  A: 

You can refresh it with the following JavaScript:

window.opener.location.reload(true);
Alexander Gyoshev
+1  A: 
window.opener.location.reload(true);

true makes sure that the page is reloaded from the server instead of the browser's cache.

This will work only if the second page was opened by the first page using javascript and not when you open a link in the first page in a new window - window.opener will be null in the later case. Even in the former case, Firefox will throw a 'permission denied' error if both pages are not from the same domain.

Amarghosh
its not working with mozilla
Rajesh Rolen- DotNet Developer
Just tested it on firefox with firebug. It works only if both pages are from same domain - otherwise you'll get a permission denied error.
Amarghosh