protected void timer1_tick(object sender, EventArgs e) { if (TimeAllSecondes > 0) { TimeAllSecondes = TimeAllSecondes - 1; if (TimeAllSecondes < 0) { Session["endtime"] = DateTime.Now; //Session["SubjectID3"] = txtsubid.Value; //Session["SubjectName3"] = txtsubname.Value; mcqmethod.update_astatus(Convert.ToString(Session["empid"]), Convert.ToInt32(Session["EXAMID"])); Response.Redirect("~/MCQ/students/s_thankyou.aspx"); } } TimeSpan time_Span = TimeSpan.FromSeconds(TimeAllSecondes); hh = time_Span.Hours; mm = time_Span.Minutes; ss = time_Span.Seconds; lblTimer.Text = " Your exam time is remaining : " + hh + ":" + mm + ":" + ss + "[H:M:S]"; } <asp:Timer ID="timer1" runat="server" Interval="1000" OnTick="timer1_tick" ></asp:Timer>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)