Even though many of the articles can be found on this topic i.e. chat rooms in asp.net.
But the following has helped me a lot in creation of a chat application.
the following link implements your desired logic, by storing messages in a SQL table only untill the receiver receives it.
For further detail and implementation download the zip project and read the complete article.
Chat-Application-in-ASP-NET-Using-AJAX-Pop-up
NOTE: the application is in VB but can be converted in C# by any online converter.
Hope it will help you. :)