Assign current time to asp label (C#)
<%@ Page Language="C#" %> <script runat="server"> void Page_Load() { lblServerTime.Text = DateTime.Now.ToString(); } </script> <html> <head> <title>First Page</title> </head> <body> <form id="form1" runat="server"> <div> Welcome to ASP.NET 2.0! The current date and time is: <asp:Label id="lblServerTime" Runat="server" /> </div> </form> </body> </html>