How to close the current tab in the server side button click?

asp.net, c#, cross-browser, javascript, jquery

Solution

If you want to close the current window, you could try this:

string jScript = "<script>window.close();</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "keyClientBlock", jScript);

Problem

I try to close my current tab after confirm so i put the following code at the end of my confirm button , but the tab doesn't close ! ``` string jScript = "<script>close_window();</script>"; ClientScript.RegisterClientScriptBlock(this.GetType(), "keyClientBlock", jScript); ```

Original source