本文介绍了如何在asp中使用计时器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在asp中使用计时器?
解决方案
好的,参考这个问题,这是最好的参考源代码,下载它,看看计时器在线考试的工作原理...... C#ASP NET中的在线考试 [ ^ ] All The Best: - )
这个例子将指导你。 < div > < asp:ScriptManager ID = ScriptManager1 runat = 服务器 > < / asp:ScriptManager > < asp:Timer ID = Timer1 runat = server ontick = Timer1_Tick I nterval = 2000 > < / asp:Timer > < asp:UpdatePanel ID = UpdatePanel1 runat = server > < ContentTemplate > < asp:Label ID = Label1 runat = server 文本 = 标签 > < / asp:标签 > < / ContentTemplate > < 触发器 > < asp:A syncPostBackTrigger ControlID = Timer1 EventName = 勾选 / > < /触发器 > < / asp:UpdatePanel > < / div >
受保护 void Page_Load( object sender,EventArgs e) { } protected void Timer1_Tick( object sender,EventArgs e) { Label1.Text = DateTime.Now.ToString(); }
最好的问候 M.Mitwalli
ASP.Net中的计时器 [ ^ ] msdn.microsoft/en-us/library/bb386404 .aspx [ ^ ]
how to use timer in asp?
解决方案 OK, With reference to this question this is the best source code to be referred, Download it and see how timer works in Online Exams... Online Exam in C# ASP NET[^] All The Best:-)Hi , This Example will Guide you . <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="2000"> </asp:Timer> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" /> </Triggers> </asp:UpdatePanel> </div>protected void Page_Load(object sender, EventArgs e) { } protected void Timer1_Tick(object sender, EventArgs e) { Label1.Text = DateTime.Now.ToString(); }
Best Regards M.Mitwalli
Timer in ASP.Net[^] msdn.microsoft/en-us/library/bb386404.aspx[^]更多推荐
如何在asp.net中使用计时器?
发布评论