I have an application in which there are multiple users.
Now one user can send message to another. If that another user is currently logged in then there will be pop up on another user's screen else show a notification whenever he become logged in.
What should i do in this?
for this application implementaion
first step you have to do is in login page insert the names,ids of the users who are currently logged in the site into a table with a name for eg:"tblonlineusers"
second step in defalut.aspx page or what ever the page you have implement, do
the following code for checking who are currently online.
in this page take a grid view control and fill the details about names,id who are in online.
the code is
public void fillonlineusers()
OleDbDataAdapter da = new OleDbDataAdapter("select * from tblOnlineusers", olecon);
DataSet ds = new DataSet();
gridview1.DataSource = ds.Tables;
catch (Exception e1)
this step makes find users currently logged in.
so in the above step count number of users
then write the code whatever you want.
print a default message
hope this is helpful otherwise send reply i will send full source code of my project
you can use membership provider or a simple tweek is provide an active column in user table and at time user gettin logged in make this cell value as true and
this how you can resolve this problem.
take a look at this <a href="http://www.codeproject.com/KB/aspnet/CustomMembershipProviders.aspx">link</a> code project membership provider.
But remember this is only used when you want to perform all the user related tasks with this.
Edited 30-Nov-11 17:26pm
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)