Global.asax
how to update a database when session expires (session time out occurs) or browser is closed
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhimanyu K VatsaPosted Jul 4, 2011, 10:18 AM
In the code given below, I'm updating the last visit of any registered user on my site. To do this, I'm just catching the user identity and then updating appropriate last login information in db. Find the code below:
nishant ranjanPosted Jul 19, 2011, 2:59 AM
Abhimanyu K VatsaPosted Jul 18, 2011, 9:48 AM
place my code in try catch block also check the login method you will be using. provided code is live on my many sites.
check by creating application variable when user login and use this instead of User.Identity.Name.
nishant ranjanPosted Jul 18, 2011, 7:59 AM
nishant ranjanPosted Jul 4, 2011, 5:52 AM
i mean how to run update command in session_end in global.asax
actually hv nt worked with global.asax
Jiteendra SampathiraoPosted Jul 4, 2011, 4:34 AM
Better to write the functionality in Global.asax file.....
Amit ChoudharyPosted Jul 4, 2011, 4:29 AM