Auto refresh parent window without closing popup window in ASP.Net

Mohammed Imtiyaz Jun 1, 2014

This sample code will show you how to auto refresh parent window without closing popup window in ASP.Net from CodeBehind.

C#

protected void btnSubmit_Click(object sender, EventArgs e) {
    ClientScript.RegisterClientScriptBlock(this.GetType(), "", "window.opener.location.href=window.opener.location.href;", true);
}

VB.Net

Protected Sub btnSubmit_Click(sender As Object, e As EventArgs)
    ClientScript.RegisterClientScriptBlock(Me.[GetType](), "ClosePopup", "window.opener.location.href=window.opener.location.href;", True)
End Sub