Update Database after session timeout and browser closed.
Does anyone who has the best reference on the subject?, i have search the net but unlucky to get one.
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.
arun kumarPosted Jan 7, 2013, 4:29 AM
On the form_load event in every page, write the below code.
Response.AppendHeader("Refresh", "60; URL=../default.aspx")
Default session time out is 20 minutes and I am using "60" seconds for this demo. If there is no activity in this period of time, then it goes back to the default or home page and we send a key to update the database "session key" or any other tag. This way we can possibly know the activity of the user or member.
This worked for me.
You can learn more about sessions here...
http://www.encodedna.com/2012/12/session-variable-in-asp.net-class.htm
Suthish NairPosted Feb 9, 2011, 1:12 PM
Herald SuvaPosted Jan 5, 2011, 10:48 PM
Herald SuvaPosted Jan 5, 2011, 1:23 AM
Manikavelu VelayuthamPosted Jan 5, 2011, 12:58 AM
Herald SuvaPosted Jan 5, 2011, 12:49 AM
Manikavelu VelayuthamPosted Jan 5, 2011, 12:46 AM
Herald SuvaPosted Jan 5, 2011, 12:39 AM
Manikavelu VelayuthamPosted Jan 5, 2011, 12:30 AM
Browser Closed event can be handled in the OnUnload Event of the body tag in the aspx page.
Put your functionality to update the database in the above two events, that would solve your problem
Krishna GaradPosted Jan 5, 2011, 12:29 AM
http://www.c-sharpcorner.com/Forums/UploadFile/103930/