I would like to close the browser window when an ASP.NET operation has succeeded. The code below is triggered by a button that resides in an Ajax UpdatePanel.
Page.ClientScript.RegisterClientScriptBlock(typeof(LeaveApproval), "ShowSuccess", "<script language=javascript>window.opener=self; self.close();</script>");
However, this code does not seem to have any effect. The window is not closed. When I enter the javascript into the URL bar of my browser it works fine, so I'm guessing this has something to do with using the ClientScriptManager together with Ajax.
Any idea what I am doing wrong?