Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Using Timer and Update Panel to update a label

$
0
0

Hi

I appreciate your help with this. I am creating a very simple aspx page with 1 label and 1 button. I am trying to update the label every 200 ms by adding 1 to the previous value. when I run the program the label stops at 1:

PublicClassWebForm1InheritsSystem.Web.UI.PageProtectedSubPage_Load(ByVal sender AsObject,ByVal e AsSystem.EventArgs)HandlesMe.LoadEndSubDim c =0ProtectedSubTimer1_Tick(sender AsObject, e AsEventArgs)HandlesTimer1.Tick

        c = c +1Label1.Text= cEndSubProtectedSubButton1_Click(sender AsObject, e AsEventArgs)HandlesButton1.ClickTimer1.Interval=200Timer1.Enabled=TrueEndSubEndClass
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication13.WebForm1" %><!DOCTYPE html><htmlxmlns="http://www.w3.org/1999/xhtml"><headrunat="server"><title></title></head><body><formid="form1"runat="server"><asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager><asp:UpdatePanelID="UpdatePanel2"runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate><div></div><asp:LabelID="Label1"runat="server"Text="Label"></asp:Label><asp:ButtonID="Button1"runat="server"Text="Button"/></ContentTemplate></asp:UpdatePanel><asp:TimerID="Timer1"runat="server"></asp:Timer></form></body></html>

Can you please tell me what I am doing wrong?

Cheers

</div> </div>


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>