如何在每秒减少时间的情况下显示在线检查的起草时间。 [英] how to show lefted time for on-line examination with reducing time every second.

查看:61
本文介绍了如何在每秒减少时间的情况下显示在线检查的起草时间。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表类型的考试和列考试。它以几分钟(例如70)保存考试完成时间。



现在这个值应该每秒减少,更新的值将在标签中显示。



我正在做的是...

i have a table Exams and column examHours of int type. it saves the exam completion hours in minutes(e.g 70).

now this value should decrease in every second and updated value will be visible in a label.

what i am doing is...

public partial class GiveExam : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string strtitle = Request.QueryString["title"];
            string examID = Request.QueryString["exmid"];
            LblExmNm.Text = strtitle;
            SqlCommand cmd = new SqlCommand("select distinct examHours,totalQn from dbo.Exams where examID=@examID");
            cmd.Parameters.AddWithValue("@examID", examID);
            DataSet ds = GlobalConnect.ExecuteDataSet(cmd);
            if (ds != null && ds.Tables.Count > 0 )
            {
                lblTotQns.Text = ds.Tables[0].Rows[0][1].ToString();
                int TotalTime = Convert.ToInt32( ds.Tables[0].Rows[0][1].ToString());//here value is 70
            }
           
        }
    }
}





请建议我该怎么做,我可以在这里使用计时器吗? />
谢谢。



please suggest me what should i do, can i use here timer?
thanks.

推荐答案

试试这个:





asp.net中的倒数计时器 [ ^ ]


试试这个:

使用ASP.NET计时器控件和Ajax创建倒计时器 [ ^ ]


这篇关于如何在每秒减少时间的情况下显示在线检查的起草时间。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆