Sometimes you need a control over browser window behaviour, i.e. open a new one and close it, eventually.
This is really simple. All you need to write is one liner code.
To open an window:
window.open ("http://www.google.com","window"); Then you can close it by:
window.close();
In ASP.NET you have variety of ways to achieve browser window close. One example:
closeButton.Attributes.Add("onclick", "window.close();")
By this, close functionality is dynamic added to the control event.
Important: you can close a browser window with code which was open by the code.
However, this open/close window java script technique is more or less obsolete. If you need to display a special "window" to the user, you should use modal windows. ASP.NET AJAX have a nice control, called
"ModalPopup".