Click here to Skip to main content
11,796,393 members (69,768 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET
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 22-Feb-13 0:20am
Dec90 at 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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try this 1,
btnClose.Attributes.Add("onclick", "javascript:opener.location.reload(false);self.close();");
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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() {

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
0 Maciej Los 530
1 Abhinav S 392
2 OriginalGriff 340
3 CPallini 269
4 KrunalRohit 249
0 OriginalGriff 2,012
1 Maciej Los 1,725
2 KrunalRohit 1,310
3 CPallini 1,055
4 ppolymorphe 858

Advertise | Privacy | Mobile
Web04 | 2.8.151002.1 | Last Updated 26 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100