Posted on: 5/22/2014 11:24:05 AM | Views : 404

I wrote a chat application just using updatepanels.  One update panel has a timer in it, and conditionally updates other update panels when people's chat messages get stored in a database.
But one problem is detecting who is eligible for a chat.  I generally go through the entire list of possible users of my site, and check the membership isonline function to see if they are online.
If they have closed their browser, then presumably they are not eligible.  But the isonline function does not detect that.  It works by a time interval instead.
So I thought of doing this:  In the html, I would have:
< body onbeforeunload="somefunction... This function would call a webservice, which would log out the user (I'm using membership to check who is logged in).   Then that person would no longer be 'online'.
Is this a reasonable approach?  Would it work?

Go to the complete details ...