<div id="Divn1" onmousemove="MyNewFunction(event)" onmouseout="ClearCoor()" style="width:99%; height:99%; border:solid;background-color:white; position:absolute;"> <p id="Demo1"></p> <asp:Label ID="Label2" runat="server" Font-Size="XX-Large"></asp:Label> <div id="Divn2" style="width:50px;height:50px;border-radius:50%;background-color:brown; position:absolute; top:45%; margin-left:47%;"> </div> <asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Font-Size="XX-Large"></asp:Label> <asp:Timer ID="tm1" Interval="1000" runat="server" ontick="tm1_Tick" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="tm1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> </div>
public static Stopwatch sw; protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { sw = new Stopwatch(); sw.Start(); } } protected void tm1_Tick(object sender, EventArgs e) { long milsecs = sw.Elapsed.Milliseconds; if (Label2.Text.Trim().Length > 0) { Label1.Text = DateTime.Now.ToString("00:ff"); } sw.Stop(); //Label1.Visible = false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)