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.
精彩评论