Click here to Skip to main content
15,906,569 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have i gridview in which I have a button. After clicking the button a popup opens.
But when I close the popup the control doesnot transfer to the page load event of parent web form.

how can i do this?
Posted

You need to trigger a parent page load from JavaScript.
JavaScript
window.close("");
parent.refresh();

OR
JavaScript
window.close();
if (window.opener && !window.opener.closed) {
window.opener.location.reload();
}



Alternatively, if you are using Ajax, have a look at this article:
Partial update of parent page via AJAX (ASP.NET 2.0) on close of a child window - conditionally[^]
 
Share this answer
 
What kind of popup are you using? Another window or a hidden div?

I would hope the latter since that wouldn't be blocked by your browsers popup blocker.

you could then just call (check this I could be wrong.) parent.refresh();

if it's the former.

window.opener.location.reload(); attached to your onunload event of the child window.

Personally I would roll something using jquery and use an ajax call to call the specific method to rebind your gridview.

This would get you started.

http://api.jquery.com/jQuery.post/[^]
 
Share this answer
 

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



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