how to make a facebook-like chat
You basically just use AJAX to "subscribe" to messages pushed by a chat server. Then the client "publishes" messages which the server pushes to any clients subscribed to that channel.
NodeJS is great for instant ajax stuff like facebooks live feed or chat (Check out this open source example).
You can also give a look at the AjaxIM project which has a chat bar like facebook and has a NodeJS server and a PHP server (I suppose you could port that over to ASP.Net). I'd reccomend going with the NodeJS server and just use the javascript library to connect to it from your project.
A friend of mine released a project for helping to write the backend of such a feature, it's called the LiveChat Starter Kit and is available on CodePlex. I never tried it so can't comment on its use, but it have gathered some attention there. I think it's more curtailed to commercial websites for providing online support tough.
All that happens is that the javascript on the client uses ajax to send outgoing chat to the server, and the server uses ajax to send incoming chat to the client.
Of course there are a lot of different pieces involved but if you have questions about those, you should ask them.
I would suggest to use XMPP as it an open standard and quite a few implementations also available, following are some links which may help:
Ajax jabber/XMPP client recommendations (real experience only please) !
http://xmpp.org/
http://www.jabber.org/
精彩评论