Solved

ASP.net VB.net Timer event not firing

Posted on 2014-02-16
6
713 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now