How to update parent page from child page in asp.net 2.0

I have a page showing all products in a gridview. I have a link on a page that clicks on it opens a modal window. The modal window has a form for entering the product and saving. When I fill out the form and save the product, I need to update the parent page so that the new product is listed in the gridview and the message will be shown on the label in the modal window. I need to refresh the product listing page without closing the modal. How to do it?

Please, help.

+2


source to share


2 answers


You can update it with the following JavaScript:



window.opener.location.reload(true);

      

+3


source


window.opener.location.reload(true);

      

true

ensures that the page is reloaded from the server instead of the browser cache.



This will only work if the second page was opened by the first page using javascript, and not when opening the link on the first page in a new window - it window.opener

will null

in the latter case. Even in the first case, Firefox will throw a "permission denied" error if both pages don't belong to the same domain.

+1


source







All Articles