3

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); 
Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392

3 Answers3

5

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

string jScript = "<script>window.close();</script>";
ClientScript.RegisterClientScriptBlock(this.GetType(), "keyClientBlock", jScript);
Felipe Oriani
  • 37,948
  • 19
  • 131
  • 194
1

This might help

Response.Write("<script>parent.close_window();</script>");
panky sharma
  • 2,029
  • 28
  • 45
1

I Just Add Following code on button.

OnClientClick="javascript:window.close();"
user3405179
  • 184
  • 11