Click here to Skip to main content
16,020,111 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to implement a live update feature in my webapp. Whenever there is a status change (update) happening in my table i need to keep showing them on the page. What would be the best way to implement such feature?
Posted

AJAX. This is exactly what it is designed for. Your page will need to poll the server to ask for updates, as HTTP doesn't hold the connection open to allow servers to communicate with pages after they're sent. You can do this with a JS timer (setInterval or setTimeout). You should call a server script which returns information about what has been changed, and your AJAX callback should parse that information and update the display accordingly.

(You can just have the script send a complete new copy of the table and overwrite the whole element, but that has issues if the user has scrolled, selected etc within it. It's nicer to update in place if you can. Making that work nicely with the HTML that ASP.net produces might be hard, though.)
 
Share this answer
 
you can refresh the page after a fixed interval to display records from table just like igoogle. And if you don't want to refresh the entire page you can use Ajax Update Panel to make partial postback.

hope it helps :)

for further queries comment here!!
 
Share this answer
 
Comments
adnan_1985 11-Jul-11 6:33am    
Thanks for the reply. Displaying the results on the page is not a problem. How do i pick only the changed records from the database? Do i define triggers?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900