To set the current login user ID to a table of test 2 on the login button, delete it when the user clicks "exit". But if the user does not press "Exit" to close the browser directly, why does SESSION_END do not work? The following is the code in session_end. Thank you. Protected void session_end (Object sender, Eventargs e) {response.write ("
" "session_end" "
"); string strsssion = session ["usid"]. TOSTRING ();
String myconnstring = "provider = microsoft.jet.Oledb.4.0; data source =" server.mappath ("wlhy.mdb"); string strsql = "delete from test 2 where usiD = '" strsssion ""; OLEDBConnection Objconn = new oledbconnection (MyConnString); OLEDBCommand Objcomm = New OLEDBCOMMAND (STRSQL, OBJCONN);
Objconn.open (); Objcomm.executenonQuery (); objconn.close ();
Session.abandon ();