Question: I have a pop-up called PopUp1 (page0.aspx). When the user clicks a row in PopUp1's GridView, it opens a new pop-up that loads my page1.aspx.

If the user clicks a link in the new pop-up (page1.aspx), then the content will be replaced with that of page2.aspx.

What I want: If the user closes the window of my second pop-up that opens page1.aspx or page2.aspx, then refresh PopUp1 (page0.aspx). 

How can I do that via jQuery ?

Answer: 
in page1.aspx and page2.aspx add some javascript to refresh their parent (you don't need any jquery for this)

In your markup:

```
<body onunload="refreshParent();">

```

In your javascript:

```
var refreshParent = function () {
    if (opener && !opener.closed) {
        opener.location.reload();
    }
};

```

Edit: alternatively, if you want to keep your logic seperated from your markup:

```
$(window).unload(refreshParent);

```
In your new popup (page1.aspx or page2.aspx), put the following jQuery and it should refresh the opening window when that popup is closed or refreshed:

```
$(window).unload(function(){
    window.opener.location.reload();
});

```

If you'd like you could also change the location of the opening page by using the .assign method if you want to do some kind of workflow logic in your page,
for example `window.opener.location.assign('http://newurl');`