Click here to Skip to main content
15,179,246 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to achieve following.
1. A link on a parent page will open a new child pop-up.
2. In child pop-up, user enters some data and click save.
3. A data will be saved to databse and pop-up would be closed. A main parent window would be refreshed and conetents entered in a child pop-up would be displayed on a parent page.

I tried following:
btnClose.Attributes.Add("onclick", "javascript:opener.location.reload(true);self.close();");


Problem is when I click the close button of popup window, it asks whether to resend or cancel the request to parent page. Which i want to avoid.

Any solution?

Thanks in avance
Posted
Comments
Dec90 22-Feb-13 6:23am
   
try opener.location = opener.location instead as I think that will create a new request rather then post the form again.

Try this 1,
btnClose.Attributes.Add("onclick", "javascript:opener.location.reload(false);self.close();");
   
I added the following in parent page which will be called when the popup window is closed, which in turn populates the grid with the data added from the popup window

<asp:button id="btnHidden" runat="Server" style="display:none" onclick="btnHidden_Click" xmlns:asp="#unknown" />


Javascript code in popup window
function RefreshParent() {
           window.opener.document.getElementById('cphPage_btnHidden').click();
           window.close();
       }


this solves all my problem
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900