public static string GetParentPopup
{
get
{
if (HttpContext.Current.Session["ParentPopup"] == null)
{
return (string.Empty);
}
else
{
return (string)(HttpContext.Current.Session["ParentPopup"]);
}
}
set
{
HttpContext.Current.Session["ParentPopup"] = value;
}
}
The code snippet above retrieves the parent of a popup window.
Below is how I trigger the pop-up window from a link button click event in the parent window:
protected void OpenPopup_Click(object sender, ImageClickEventArgs e)
{
string script = "<script>ChangeLocationPopup();</script>";
this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "openPopup", script);
}
This is also how I close the popup window by clicking a button on the popup page:
protected void ClosePopup_Click(object sender, ImageClickEventArgs e)
{
string script = "<script>ChangeLocationPopup();</script>";
this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "closePopup", script);
}
Now, I want to reload the parent page to refresh the data. If I know the URL of the parent page as retrieved in the first code snippet above, how can I ensure it gets refreshed upon closing the popup form using btnClosePopUp_Click?