开发者

Countdown in ASP.NET

开发者 https://www.devze.com 2022-12-22 18:39 出处:网络
I need to give the countdown as shown here, for each item using ASP.NET with C#. Any ideas on how to solve this p开发者_C百科roblem?You can use setInterval method to implement a count down timer.

I need to give the countdown as shown here, for each item using ASP.NET with C#.

Any ideas on how to solve this p开发者_C百科roblem?


You can use setInterval method to implement a count down timer.

You can get the initial time from the server. And then use javascript to get the count down timer working.


To do this you could use ajax. http://www.asp.net/ajax/

Specifically you could use this control http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AlwaysVisibleControl/AlwaysVisibleControl.aspx


You need a webservice that can give the state (time left, current price, #bids etc) of all the items visible on the page back to the client.

The client uses typically AJAX / JSON to retrieve the state of all the items on the page and then jquery to update the countdown timers/bids on each item on the page.


That site is using AJAX, as you can see from the regular refreshes that occur to the individual timers. You can create a web service or web method to consume. If the times don't need to be refreshed during the life of the page, then I would stick with a simple JavaScript countdown using jQuery or the link the @kieran shared.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号