Solved

ASP.net VB.net Timer event not firing

Posted on 2014-02-16
6
734 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:murbro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:murbro
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:murbro
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 500 total points
ID: 39863337
0
 

Author Closing Comment

by:murbro
ID: 39864599
Thanks very much
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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