its very easy, make a database table "tblchat" with columns (ID, UserID, Message). make a textarea on the page and also add a timer and set its interval to lets say 5 seconds. on every timer_tick event fetch all records from the database and add them into
textarea
Yes, I think this is the only way to achieve this, so I have implemented it below ways.
Message store in database and updated datetime store in application variable, so each time when timer ticks then check if chat widows timer variale less then last updated server's time, if yes then refresh chat window with updated chat. So I have used both
application varialbe for basic chat id and updated time store and database for main chat message storage.
Thanks,
Amit
My Tech Blogs MCPD Enterprise and Web Application
MCTS Web, Window and Enterprise Application
Marked as answer by amitpatel.it on May 08, 2012 05:53 AM
amitpatel.it
Star
7946 Points
1865 Posts
Re: Implement Live chat functionality in asp.net application
Apr 23, 2012 02:03 PM|LINK
Is there any other good option to save chat data ?
MCPD Enterprise and Web Application
MCTS Web, Window and Enterprise Application
cYpH3r x3r0
Member
327 Points
107 Posts
Re: Implement Live chat functionality in asp.net application
May 03, 2012 01:35 PM|LINK
its very easy, make a database table "tblchat" with columns (ID, UserID, Message). make a textarea on the page and also add a timer and set its interval to lets say 5 seconds. on every timer_tick event fetch all records from the database and add them into textarea
amitpatel.it
Star
7946 Points
1865 Posts
Re: Implement Live chat functionality in asp.net application
May 08, 2012 05:53 AM|LINK
Yes, I think this is the only way to achieve this, so I have implemented it below ways.
Message store in database and updated datetime store in application variable, so each time when timer ticks then check if chat widows timer variale less then last updated server's time, if yes then refresh chat window with updated chat. So I have used both application varialbe for basic chat id and updated time store and database for main chat message storage.
Thanks,
Amit
MCPD Enterprise and Web Application
MCTS Web, Window and Enterprise Application