In an aspx page, to click a button (server-side control) to close the current page, you only need to add the following statement to the page_load() method of the aspx page:
this.btnClose.Attributes.Add("onclick","window.close()");//btnClose is the name of the button. This statement adds a click attribute to it and calls the window.close() method.
2> In the HTML page, to click a button (HTML control) to close the current page, you only need to add an onclick attribute to the button control code in the HTML code. The code is as follows:
< INPUT id="Button1" type="button" value="Button" name="Button1" onclick="window.close