Click here to Skip to main content
12,243,303 members (46,442 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
How can i refresh a parent page when a popupwindow load has completed in ASP.NET...?
Posted 13-Dec-12 4:44am
Comments
aspnet_regiis -i 13-Dec-12 9:45am
   
Not possible.. The popup window does not know who his parent is ....
Member 9581488 13-Dec-12 9:49am
   
On popup Body Onload=="jsFunction()"

Else...

<script>
window.onload = refreshParentPage;
function refreshParentPage() {
window.opener.location.reload();
}
</script>

I am not 100% sure but You can try the above function.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

<pre lang="cs">string Script = "window.parent.location=window.parent.parent.location;";
        ClientScript.RegisterClientScriptBlock(typeof(Page), "Close", Script, true);

use the above if you are calling aspx page in the popup

or simply use

<script language="javascript">
function closeandrefresh()
{
   window.parent.location=window.parent.parent.location;
}
</script>

call the above function when the close event is called.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

i use this

Response.Write("<script language="javascript">")
Response.Write("opener.location.href=opener.location.href;")
Response.Write("window.close();")
Response.Write("</script>")
  Permalink  
Comments
Saneesh PK 13-Dec-12 10:31am
   
Thanks for the reply....It is getting executed..I have given a breakpoint on the parent page load event...but it is not hitting...that means the page is not refreshing
FehPorto 13-Dec-12 10:46am
   
you used the code "refresh" when they need to refresh the page back?
Show me your code to see where the code is being called.
And the page_load of your page

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


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2016
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