?
Solved

ASP.net VB.net Timer event not firing

Posted on 2014-02-16
6
Medium Priority
?
798 Views
Last Modified: 2014-02-17
Hi. I am adding  a timer dynamically using the following code and also a
handler to handle the tick event. Things don't seem to be working as the
procedure oTimer_Tick does not run


        Dim oTimer As New Timer
        oTimer.ID = "xTimer" & CStr(oChartGridViewID_Counter)
        oTimer.Interval = "10000"

        Dim up As New UpdatePanel
        up.ContentTemplateContainer.Controls.Add(oTimer)
        up.ContentTemplateContainer.Controls.Add(oGridView)

        T.Rows(0).Cells(oColumn).Controls.Add(up)
        AddHandler oTimer.Tick, AddressOf oTimer_Tick

    Private Sub oTimer_Tick(ByVal obj As Object, ByVal e As EventArgs)
        'Display current time in lable...
        lblNowDateTime.Text = Date.Now.ToString
    End Sub
0
Comment
Question by:Murray Brown
  • 3
  • 2
6 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39862590
What is the overall program flow? How were you anticipating this timer should work?
0
 

Author Comment

by:Murray Brown
ID: 39862594
Well I am adding several GridViews to table cells and want to refresh the bound data every few seconds. I started by trying a single timer at the top of the page but the postback wiped out all my GriViews, so now I am trying to add a timer for each GridView so that every few seconds I can refresh the data coming from SQL
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39862645
You do understand how the web works, right? By that I mean the whole request/response workflow.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:Murray Brown
ID: 39862685
Not well. Fairly new to it. I have resorted to using one timer
      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Timer ID="Timer1" runat="server" Interval="50000">
            </asp:Timer>
        </ContentTemplate>
        </asp:UpdatePanel>

Maybe you could give me a quick pointer on the best way to refresh my dynamically added GridViews

Thanks
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 39863337
0
 

Author Closing Comment

by:Murray Brown
ID: 39864599
Thanks very much
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month17 days, 12 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question