.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Javascript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Javasceript to close the child window and refresh the parent window

Posted By:Maverick       Posted Date: July 26, 2011    Points: 40    Category: Javascript    URL: http://www.dotnetspark.com  

Javasceript to close the child window and refresh the parent window. Below is the javascript block used in C# to close the child popup and refresh the parent window (Update Panel used in aspx).
 

Hello All,

Below is the javascript block used in C# to close the child popup and refresh the parent window (Update Panel used in aspx).

  string parentLink = "Parent.aspx?UserId=" + UserId;
            string closeScript = "window.opener.location.href=" + "'" + parentLink + "'" + "; window.close();";
            ScriptManager.RegisterStartupScript(thisthis.GetType(), "CloseWindow", closeScript, false);

The above code will close the child window and refresh the parent page.
Hope it helps.

Thanks,
Maverick

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend