You can use below code on the close button click event of your popup window for reloading the parent page of the popup window when the popup is closed.
protected void Button1_Click(object sender, EventArgs e)
{
string strString = "<script language='javascript'>window.opener.location.href = window.opener.location;</script>";
RegisterStartupScript("ReloadParent", strString);
string strString1 = "<script language='javascript'>window.close();</script>";
RegisterStartupScript("Close", strString1);
}
If you are using a ajax ScriptManager on your popup window use the below code.
protected void Button1_Click(object sender, EventArgs e)
{
string strString = "<script language='javascript'>window.opener.location.href = window.opener.location;</script>";
ScriptManager.RegisterStartupScript(Button1, Button1.GetType(), "ReloadParent", strString, false);
string strString1 = "<script language='javascript'>window.close();</script>";
ScriptManager.RegisterStartupScript(Button1, Button1.GetType(), "Close", strString1, false);
}
Thursday, December 6, 2012
Reload parent page on popup window close in ASP.NET
Subscribe to:
Post Comments (Atom)
No comments:
Write comments