wep page close event
hello evryone. i have a problem. i want to make changings on database when user close the web page or web browsser. i want to mmake visitors status offline when user leaves site or close the browser but there is no closing event or sth like closing event. do i miss closing event. i hav another problem a bit diffrent. whenn starting the web site from visiual studio i have no problem about databaase i can edit, delete values on tables. but when i try the web page on my browser calling it from under wwwroot (i published website and placed it under wwwroot)and try to change sth on database tables it says the database is read only. i attach an sql database to my project. how can i make the database writable or editable.
i hope i have clearly tell my problems, if i have miswritten sth sory for that
Munir ShaikhPosted Jul 30, 2007, 5:01 AM
We can catch web page close event but that is in javascript here is small script if you want:
suppose you have "test.aspx" page and on close of the same if you want some function to fired here is small snippet
<
body onunload="javascript:do_Change(30000);">& in the head section have this
<
head runat="server"><title>Untitled Pagetitle>
<script language="javascript">
function do_Change(delay)
{
alert("Hi we are here!");
location.href="./DbActivities.aspx"
alert("Ok "+delay/1000+" seconds have elapsed");
setTimeout(string,delay);
//location.href="./DbActivities.aspx"
}
script>
head>
But i hope you will not get what you want for the same small idea: you can show only those people who are logged in and have some session activities, maintain a session with user name and once page is closed session will automatically abandan so automatically only those who has session will be there in the online users.
Enjoy
Regards,
>>Munnamax
nkayPosted Jul 23, 2007, 2:08 AM