Solved

ASP.net VB.net Timer event not firing

Posted on 2014-02-16
6
726 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
  • 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

829 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