Solved

ASP.net Dynamically add timer to update panel

Posted on 2014-02-15
3
592 Views
Last Modified: 2014-02-15
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
Comment
Question by:murbro
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39861557
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
 

Author Comment

by:murbro
ID: 39861572
Thanks. Do I just rebind the GridView and not do anything to the UpdatePanel?
0
 

Author Closing Comment

by:murbro
ID: 39861665
Thanks
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

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 …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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