关于asp.net中的计时器的问题 [英] Question on timer in asp.net

查看:76
本文介绍了关于asp.net中的计时器的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目是在线检查,因为对于每个问题,我都以10秒为间隔,这意味着每10秒就会自动更改que,而无需单击Java脚本中的下一步"按钮.我的问题是,如果用户单击10秒以下的下一个按钮,则会添加剩余的秒数或继续进行下一个查询.我不想要,下一个也要花10秒..plz帮助我做到这一点..
示例代码是

my project is online examination, in that for every question i have put 10 sec as interval that means after every 10 secs automatically the que changes irrespective of clicking ''next'' button in java script. my problem is if user is clicks next button below 10 sec, the remaining secs are added or continue to the next que. i dnt want that, fr next que also it shud take 10 sec.. plz help me to do this..
sample code is

<asp:ScriptManager ID="ScriptManager1" runat="server" />
        <asp:Timer runat="server" id="UpdateTimer" interval="10000" ontick="UpdateTimer_Tick" />
        <asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
            </Triggers>
            <ContentTemplate>

推荐答案

您将不得不在Page_Load上重新设置计时器.使用以下

You will have to re-set the timer on Page_Load. Use following

Timer1.Enabled = true;
Timer1.Interval = 10000;


在一页用户上停留的时间不能超过10秒.如果在接下来的10秒钟之内点击它,则将剩余部分添加到会话中并显示为
on one page user cannot be stay more then 10 sec''s. if it''s click''s next early then 10 sec, then add remaining to session and display it as
10 sec + remaining of previous page(session value)...



即使您想将所有剩余时间都分配给用户,则在页面加载时将计时器间隔时间更改为



and even if you want to give all remaining time to user then at page load change the timer interval time to

10 sec + remaining of previous page(session value)...


这篇关于关于asp.net中的计时器的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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