Timer的问题,知道的快来拣分啦:)
我照网上的例子做的代码如下,可是Timer里的事件好像根本没发生啊,结果就是在UpdatePanel 里的LabelIn 内容不发生改变
例子的原型是在http://www.cnblogs.com/Terrylee/archive/2006/11/14/Introduction_to_the_Timer_Control.html 里
下面是我的代码
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head runat= "server ">
<title> 无标题页 </title>
</head>
<body>
<form id= "form1 " runat= "server ">
<div>
<asp:ScriptManager ID= "ScriptManager1 " EnablePartialRendering= "true " runat= "server ">
</asp:ScriptManager>
<asp:UpdatePanel ID= "UpdatePanel1 " runat= "server ">
<ContentTemplate>
<asp:Timer ID= "Timer1 " runat= "server " Interval= "10000 " OnTick= "Timer1_Tick ">
</asp:Timer>
<asp:Label ID= "LabelIn " runat= "server " Text= "Label Display "> </asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID= "Timer1 " />
</Triggers>
</asp:UpdatePanel>
</div>
<asp:Label ID= "LabelOut " runat= "server " Text= "Label "> </asp:Label>
</form>
</body>
</html>
--------------------
Partial Class Temp
Inherits System.Web.UI.Page
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs)
LabelIn.Text = DateTime.Now.ToLongTimeString
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.