Last post Mar 27, 2013 06:40 AM by EnenDaveyBoy
Mar 25, 2013 10:40 AM|EnenDaveyBoy|LINK
I have a web site, and I want to put chat windows on certain pages, so I have a difference group per page where there is a chat. The chat history is never lost so is always stored in a database.
At the moment if the person starts chatting, then they are logged in to the chat, however there is no loggoff button, so if the person leaves the page how do I manage the signing out?
Mar 25, 2013 02:31 PM|Ruchira|LINK
however there is no loggoff button, so if the person leaves the page how do I manage the signing out?
You can handle it on public override Task OnDisconnected() event.
Please 'Mark as Answer' if this post helps you
Mar 26, 2013 10:45 AM|EnenDaveyBoy|LINK
thanks, I get how I remove them after Ondisscounnected will remove them from the chat list, but is there a way i can know it will happen when the user leaves the page that is reliable?
Mar 26, 2013 10:51 AM|Ruchira|LINK
but is there a way i can know it will happen when the user leaves the page that is reliable
That's the closest you can do. It might not work 100% accurately, but you can't really do anything regarding that since leaving the webpage is a client side event. Usually OnDisconnected event fires whenever a client got disconnected from the system.
Mar 26, 2013 05:26 PM|EnenDaveyBoy|LINK
thanks, how long will it take for someone to diconnect doing this?
Mar 27, 2013 12:30 AM|Ruchira|LINK
It will fire as soon as (May be miliseconds delay) the client get disconnected.
Mar 27, 2013 06:40 AM|EnenDaveyBoy|LINK
thanks for the info