I think the best way is to use third party components already available. There are some very good ones out there. For a website that i developed misternmisses.com i used the component on www.mangochat.net and it works really great. Its easy to integrate as well.
one problem i faced when i was trying to make my own was the performance that was becoming a bottle neck at all time. Not sure how Mango Chat works behind the scenes but it does a great job.
Hope this helps. There are other components as well which you can search by searching for ASP.NET Chat Control on google.