Click here to Skip to main content
14,880,764 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi !
I'm new in , please tell me how to get count of Online users in ASP.NET ?
How to find that an user is Online or Offline ?
Thanks .

For counting users, have an Application level property and increment/decrement upon session_start/session_end respectively.

If you need to check if a particular user is online/offline, you need to maintain a List of each user.

Combining both requirements, have this list as Application property and add/remove the userId upon session start/end events respectively. At any point of time, the count of the list will give the count of the Online users.
If the user is off-line she/he does not exist for your Web application, so this part of question simply makes no sense.

As to counting the users, it's pretty easy. See[^].


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900