Wilhelm
Wilhelm

Reputation: 161

Asp.Net "Instant" PM System

I need to send "instant" messages (like forum PMs) between users with my asp.net application. As many others I use a webhotel to host my site. I have searched around for awhile and I can't find any solutions that would be a good fit with my system. I was thinking about writing a javascript that would call for each 30 seconds or so a .ashx handler to check the users message status (return true or false) if the correct credentials are supplied. However I dont know if this is a good solution, because of all the calls to the handler it might get picked up as spam or it might generate really bad performance? The thing is, I want to avoid the need to refresh the page just to see your latest messages.

Upvotes: 0

Views: 310

Answers (2)

Ozgur Dogus
Ozgur Dogus

Reputation: 921

You can use an updatepanel for this. Put a textbox in an updatepanel in your page. When a user sends a message just append it to that textbox.You can put a refresh timer to refresh the contents in every second .

Upvotes: 1

dougajmcdonald
dougajmcdonald

Reputation: 20047

Take a look at the C# SignalR library, it allows you send grouped or broadcast messages to clients using longpolling or websockets with minimal bandwidth and simple code

http://signalr.net/

Upvotes: 1

Related Questions