I have searched SO & google, but I can\'t seem to get this to work. The code is in the codebehind click event of a \"Cancel\" button in my asp.net application but does
You can use this instead
ScriptManager.RegisterStartupScript(this.Page, GetType(), "ClosePopup", "window.close();", true);
or you can also try this one
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "ClosePopup", "window.close();", true);
Have a Good day.
since I could not get the ClientScript to work as required, I did a workaround using the code below:
function closeWin() {
//If txt = 'cancel' then close;
GetRadWindow().Close();
}
<td align="center"><asp:Button runat="server" ID="btnClose" Text="Close"
OnClientClick="closeWin();return false;" onclick="btnClose_Click"/></td>