Click here to Skip to main content
15,917,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Now I am on test.aspx page. On this page a botton name "close" with id "closeid". I want to close this tab by clicking on that close button.

Please give me a quick solution for this.

Thanks in advance.

What I have tried:

I have tried onclick function. It is not resolve my problem
Posted
Updated 17-Nov-17 0:40am
Comments
F-ES Sitecore 17-Nov-17 6:40am    
google "close document javascript" and I'm sure you'll find the appropriate code. In general though it's bad to have these things, if the user wants to close the tab they know how to using the "X" icon.

1 solution

use Window close() Method[^]
<asp:Button ID="Button1" runat="server" OnClientClick="window.close(); return false" Text="Close" />
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900