Click here to Skip to main content
15,913,904 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Kindly let me know steps required to achieve the following scenario:
I have to create a application with two login IDs for user1 and user2... now when user1 logs in he types a message for user2 and user2 will receive this message as a notification message. User2 cannot directly reply back to user1 but can type and send another notification message to user2 which will appear as a popup in user1 side....
Posted
Updated 21-Sep-12 2:48am
v2
Comments
Tejas Vaishnav 21-Sep-12 9:07am    
can you try push notification services concept....

i think it will solve your problem.
Sandeep Mewara 21-Sep-12 9:14am    
What do you think on how it should be done? Tried anything?

It's a different kind of chat on web you are talking of... actually, half of what actual chat is.

1 solution

Assumptions:
1) User 1 and user 2 are using an ASP.NET web application connected to an SQL Server database.

Steps:
1) Create a table in the database where sent messages are stored. The table should include a recieved bit field with a 0 default.

2) The application has a form used to send messages to the database for the intended user.

2) Using ajax, the application can use a stored procedure to check the database at intervals of your choosing (every 30 seconds or what ever you want) for messages sent by the other user that have not been recieved (still 0).

3) The stored procedure will set the received bit to 1 and return the messages to the application.

4) If messages are returned, the ajax will generate a popup to display them.

Good luck!
 
Share this answer
 
Comments
sp1786 22-Sep-12 5:19am    
What fields do i add in database table?
DaveP62 25-Sep-12 8:58am    
Based upon the requirements given it doesn't seem like the table needs a lot of fields. Assuming the application will be as simple as the requirements suggest the following fields should work:
MessageId (Integer) -- Identity field auto-incremented
FromUser (VarChar(64)) -- The name of the user sending the message
ToUser (VarChar(64)) -- The name of the user who will receive the message
MessageText (VarChar(2048)) -- The message being sent
Received (bit) -- Default = 0

You can add as many other fields as you like depending on how you use and how much functionality you want the application to have.

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