Continuously updating chat messages
<p>I'm creating a very simple chat application. It has an ASP.NET web page as front-end and a WCF service as back-end for storing the messages to a database.</p>

<p>Everything works great except one thing; when Browser A enters a chat message I want Browser B to see the message as soon as possible (yeah, I know, that's the purpose of a chat).</p>

<p>What I've done so far is to setup a trigger within the UpdatePanel, like this:</p>

<pre><code>&lt;Triggers&gt;
    &lt;asp:AsyncPostBackTrigger ControlID="chatTimer" EventName="Tick" /&gt;
&lt;/Triggers&gt;
</code></pre>

<p>which uses a timer:</p>

<pre><code>&lt;asp:Timer ID="chatTimer" runat="server" OnTick="chatTimer_Tick" Interval="1000" /&gt;
</code></pre>

<p>Is this the best approach or is there a better, yet simple, way to accomplish updating of messages. One drawback with this solution is that the textbox used to enter chat messages loses focus every time the Tick event runs.</p>

<p>Any piece of feedback or advice regarding updating of messages is appreciated.</p>

<p>Thank you!</p>
