Solved

ASP.net VB.net Timer event not firing

Posted on 2014-02-16
6
701 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 74

Expert Comment

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

Author Comment

by:murbro
Comment Utility
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 74

Expert Comment

by:käµfm³d 👽
Comment Utility
You do understand how the web works, right? By that I mean the whole request/response workflow.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:murbro
Comment Utility
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
Comment Utility
0
 

Author Closing Comment

by:murbro
Comment Utility
Thanks very much
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 …
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…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 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

11 Experts available now in Live!

Get 1:1 Help Now