Closing window using ASP.NET Button in JavaScript

We just need to add this property in your asp:Button element (Sample below):

OnClientClick="javascript:window.close();"

It works perfectly.

Sample 

 <asp:Button ID="btnClose" runat="server" Text="Close" TabIndex="11" OnClientClick="javascript:window.close();"/>

Comments