Close window on Button click in ASP DOT NET.

To close a browser window there is only one Way i.e to add JavaScript. Below are the two methods of making a browser window (page) close.Method 1 : On page load add the script to the button onclick attribute . It will occur a bit faster.Method 2 : If User wants to validate some Process before Window close, Its better to use Method 2 ,Because using the first Method no server side code will get executed..Here On Button Click Use the Script to close the window.So Before closing the window we can Validate the Process in the Applications

'Method 2 : on Button Click Use the Script Protected Sub btnClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click If Page.IsValid Then Response.Write("") End If End SubEnd Class