开发者

update time continuously on asp.mvc

开发者 https://www.devze.com 2023-04-03 20:19 出处:网络
I am having a asp.mvc file and in its S开发者_运维技巧ite.Master page, I want to update the time continuously.

I am having a asp.mvc file and in its S开发者_运维技巧ite.Master page, I want to update the time continuously. Here is the code I wrote.

<asp:Label ID="DateTimeLabel" runat="server" Text=""><%= DateTime.Now.ToString()%></asp:Label>

Can anyone tell me how to change the time continuously(I don't have background code i.e. code behind file)? Thank you.


Whether you're using WebForms or MVC this would probably better done with client side Javascript. See this article for a how to. Here's an even simpler implementation with a running example.

0

精彩评论

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