Hi Shinu, Thanks for your quick response. I tried this , the alert is shown and when i click the alert the window get closed. my requirement is the restrict the Window close, after the alert shown the windows should be open.
As far as I know, the only possible solution is to use the onbeforeunload. It wont completely restrict the user from closing the browser window which is not possible either from client side or from server side but it will prompt the user asking them
whether they really want to leave or stay back, which is probably the best cross
browser solution you can manage. As per the code the message returned will also be displayed along with the standard browser "Leave Page" confirm (the message wont be displayed in Firefox). Please check the updated code and have a look at the attached screenshot.