|
Hi Guys ,
Whats the best way to implement a live update on an aspx page.Like commentary/score update of a live cricket match ?.Any good thoughts ? Please share
With Warm regards
|
|
|
|
|
Depends on how live you want it to be.
For most applications you can get away with polling the server from the client using javascript in one way or another. Jquery has a neat ajax/[^] method that will take away some of the client side pain. You can use this to get part of a web page.
If you want something a little more live-like you could consider long-polling, where you request the data immediately and the server only responds when the information has changed, or the poll interval "times out". Once the poll is done, the client re-polls immediately and the process repeats.
There is a discussion of the topic here[^]. In the article he talks about a technology called SignalR, which will help you with the long polling stuff.
|
|
|
|
|
The answer will hugely depend on the source of data that is being served. If you have some source of data that you need to put on your webpage after a regular interval then it can be easily done using AJAX . in fact, you can do it using simple ASP.NET updatepanel and timer control only.
Here is a small article that shows how to use the timer to keep the page updating after some interval. IN this demo application, only server time is being shown live to the user after certain time interval. you can simply show your data instead of that.
AJAX for Beginners (Part 1) - Understanding ASP.NET AJAX Server Controls[^]
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|