Tuesday, 22 May 2012

how to close and refresh popup window in javascript

C# code:
 protected void btn_Click(object sender, EventArgs e)
    {
               Page.ClientScript.RegisterStartupScript(GetType(), "script","x()", true);
    }

Javascript Code:

 <script language="javascript" type="text/javascript">
        function x(r) {
            window.opener.location.href = window.opener.location.href;
            window.parent.close();
            return false;
        }
    </script>

No comments:

Post a Comment