I am working on a Chat Server Application in Asp.Net with C#.
Suppose there are 5 users online say User A,B,C,D,E. Suppose A sends a message in chatbox to user B, so how the chatbox (Textbox/Textarea of chat) of User B will load the new content?
One Option is to refresh the chatbox every 10Seconds or 15 seconds but it's pretty unuseful way because as if there is no new message for the user the chatbox will still be refreshed.
I have an aspx page say client.aspx with client.aspx.cs as code behind file and server file say server.cs.
There is a send button on aspx page on click event of this button i called a method of my server file say UpdateChatbox(from,to,content) now the from is User A, to is User B and content is my msg in chatbox,
Now the question is :
How Server.cs file update the ChatBox on client.aspx page of User B?
Best Answer
SignalR is what you are looking for.
From the website:
You can have a look inside JabbR source code to see what it can do and how to do it.