Q:

event for the closingof the browser

i am having a asp.net and c#.net application and i have a page gridview.aspx which has a button "close".
when a person closes the browser page by clicking the close icon in the top right of the browser i want to perform the click event of the "close" button,
do we have any event beforebrowserclose()?

A:

function clickclosebtn() {
        if (window.event.clientX < 0 || window.event.clientY < 0) 
    {

        document.getElementById("<%= btnClose.ClientID %>").click(); 
    }

    }

