Solved

ASP.net Dynamically add timer to update panel

Posted on 2014-02-15
3
604 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…

734 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