code to logout on window close
-
I want to call my web application logout page on window close.what code should I write in javascript.
You can't, the window is going to close before the redirect occurs. The only way to get a message to the server when the window closes is to use AJAX.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
I want to call my web application logout page on window close.what code should I write in javascript.
in body tag add the onbeforeunload function
funciton abc() { if(confirm('navigate to logout')) { location.href('logout.aspx'); return false; } }
Hope this will help u. -- modified at 3:52 Thursday 15th November, 2007Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1