You could use window.onbeforeunload function in javascript
Hi avula,
Please try this...
window.onbeforeunload = function(e) {
// check condition
return 'Dialog text here.';
};
following are some links
https://developer.mozilla.org/en-US/docs/DOM/window.onbeforeunload
http://stackoverflow.com/questions/1889404/jquery-ui-dialog-onbeforeunload
Using JQuery
http://www.mkyong.com/jquery/how-to-stop-a-page-from-exit-or-unload-with-jquery/
http://dotnetkicks.com/aspnet/Use_jQuery_to_standardize_window_onbeforeunload_across_browsers
http://www.webhostingtalk.com/showthread.php?t=927093http://dotnetkicks.com/aspnet/Use_jQuery_to_standardize_window_onbeforeunload_across_browsers
http://www.webhostingtalk.com/showthread.php?t=927093