Click here to Skip to main content
11,495,331 members (51,881 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET Ajax Chat
currently I'm developing a web chat using ASP.NET with Ajax. But the problem i using Ajax async postback to query database "chat" table. So as you can see the code portion in my Chat screen, i use updatepanel with timer trigger an async postback.
<div id="chatdisplay" class="chatdisplay">
                        <asp:Timer ID="Timer1" runat="server" Interval="2000" ontick="Timer1_Tick"></asp:Timer> 
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" >
                            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
                            <asp:AsyncPostBackTrigger ControlID="btnSend" EventName="Click" />
                        <asp:Table ID="chatPanel" runat="server" Width="100%"  CssClass="tableWidth">

But the problem happen when i run the program,i'm not able to highlight and copy the text in the chat display,,, because the chat display is refresh every 2 second.
Cant everyone point out my mistake either in the way i implement ajax in my web chat or the concept is wrong.
Posted 8-May-13 0:38am
Edited 8-May-13 0:41am
richcb at 8-May-13 16:12pm
Why not refresh it when a message is sent or recieved instead of being on a timer?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Dnyaneshwar@Pune 692
1 CHill60 318
2 Sascha Lefèvre 275
3 Sergey Alexandrovich Kryukov 255
4 Nakul Chaudhari 236
0 Sergey Alexandrovich Kryukov 10,307
1 OriginalGriff 8,821
2 Sascha Lefèvre 3,889
3 Maciej Los 3,412
4 Richard Deeming 2,560

Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 8 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100