Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 26, 2012 01:47 PM by jeremys6
Mar 26, 2012 08:57 AM|LINK
Iam using asp.net 4.0 when the user closes the browser it should clear all the session values im using master page but i have put the code in onunload event in master page when i close my radwindow(child window) it s calling onunload event but it should
happen only when the browser winodw close not in the radwindow(child window ) close.
(clicked == false)
//browser is closed
//var request = GetRequest();
request = GetRequest();
xmlHttp = null;
// Firefox, Opera 8.0+, Safari
1.bodyunload function is called but when i click child window close button it goes into the redirect logout page.hw to restrict from child window(radwindow) from browser window.redirect logout page should go only when browser window close.
2.when i redirect to logout page .it does not go to logout page.it simply stop the solution.
Since its an emergency issue kindly help me out.
Mar 26, 2012 09:09 AM|LINK
you have to remeber that even if you just navigate in your application to another page, the Unload will be call...
Wha exactly are you trying to do? why do you need to interfer in the onunload event?
Mar 26, 2012 10:03 AM|LINK
thanks for the reply
How do we close all the session while closing the browser ?Is it possible to have onunload or onbeforeunload event for this or smeoter approach?if not how do we achieve that? but we should not clear the session while closing radwindow(child windows) we should
do only browser window close or file menu close or tab close.
I have global.asax file and default maste page.
Mar 26, 2012 01:47 PM|LINK
there is a couple of way to do it,
here some examples:
but the way i prefer to do it, is simply add to the Url a key, only with this key you will be able to acces to your session for example:
i have Session[TabCollection] so with the Key => Session[TabCollection+SessionKey] and the SessionKey is taken from the url, so when you are close the browser you can be sure that there is no way to retrieve again the session for the simple reason that
you will have to generate a new key for the user
hope that helped :)