Take a look at the SignalR library. It should get you started in the right direction.
However if you do want to do it yourself, the most efficient method to build this in asp.net is to use a IHttpAsyncHandler and ajax requests.
Here is a complete working project that implements this, along with ajax.