Solved

ASP.net Dynamically add timer to update panel

Posted on 2014-02-15
3
597 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 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