Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.net Dynamically add timer to update panel

Posted on 2014-02-15
3
Medium Priority
?
629 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:Murray Brown
[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 2000 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:Murray Brown
ID: 39861572
Thanks. Do I just rebind the GridView and not do anything to the UpdatePanel?
0
 

Author Closing Comment

by:Murray Brown
ID: 39861665
Thanks
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
This article discusses how to implement server side field validation and display customized error messages to the client.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

604 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