• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 680
  • Last Modified:

ASP.net Dynamically add timer to update panel

Hi

I want a number of GridViews to refresh every 10 seconds. I use the following code to dynamically add each GridView. At the top of the page I have a Script Manger and a timer
What VB.net code do I use in the Timer1_Tick to refresh all of the GridViews?


    Protected Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

    End Sub


     Dim up As New UpdatePanel
          up.ID = "up" & CStr(Me.Table1.Controls.Count)
           up.ContentTemplateContainer.Controls.Add(oGridView)
          Table1.Rows(0).Cells(oColumnIndex).Controls.Add(up)
0
Murray Brown
Asked:
Murray Brown
  • 2
1 Solution
 
CodeCruiserCommented:
You can maintain a

List(Of Gridview)

in the session and add gridview in the list when you add it. Then in timer_tick, loop through the list and databind it.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks. Do I just rebind the GridView and not do anything to the UpdatePanel?
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now