Solved

AJAX Timer1

Posted on 2008-06-16
6
430 Views
Last Modified: 2011-04-14
How do you start a timer with AJAX?


I have codebehind handing the Timer.Tick event, yet this never gets called....

<%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/Default.Master" CodeBehind="progress.aspx.vb" Inherits="UI.progress" 
    title="XXXXXXXXXX - Progress" %>
 
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyPanel" runat="server">
    <asp:UpdatePanel id="UpdatePanel1" runat="server">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
        </Triggers>
        <contenttemplate>
            <asp:Timer id="Timer1" runat="server" __designer:dtid="5066549580791809" __designer:wfdid="w10" Interval="3000" OnTick="Timer1_Tick">
            </asp:Timer>
            <BR />
            <asp:Panel id="pnlOutput" runat="server" Width="858px" Height="100%" __designer:wfdid="w9"> </asp:Panel> 
            <BR />
            <asp:Label id="lblMasterProgress" runat="server" Width="170px" Text="Progress - 0.0%"></asp:Label> 
        </contenttemplate>
    </asp:UpdatePanel>
    <asp:Button ID="btnCancelOrContinue" runat="server" Text="Abort" Width="123px" />
</asp:Content>

Open in new window

0
Comment
Question by:craigdev
  • 3
  • 3
6 Comments
 
LVL 6

Expert Comment

by:cottsak
ID: 21798875
what is it you're trying to do?
0
 
LVL 1

Author Comment

by:craigdev
ID: 21798902
refresh a progress screen every 5 seconds
0
 
LVL 6

Expert Comment

by:cottsak
ID: 21798908
the whole page (ie. you have maybe a small popup page with the progress in it)? or just part of a page and you want to use ajax to update it?
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 1

Author Comment

by:craigdev
ID: 21800950
just a page and i want to use ajax to update it,

the panel, pnlOutput, has rows of a pair of labels added at: label1 in each row has the the name of the item and the label2 shows % complete for that item. The number of rows varies and so I can't add them to the page in the designer. I am storing them in the session along with an array of business objects. In the tick event I am reloading the progress count from each object in the array and refreshing the text on the second label in each row.

The problem is the Timer1.Tick event never fires. I added a refresh button which runs the same code as the Timer1_Tick function and when I click refresh it works nicely. However I can't get the Timer to tick.
0
 
LVL 6

Accepted Solution

by:
cottsak earned 500 total points
ID: 21809185
there is no pont using ajax to post back a whole page... thats just a normal page postback!
so i'll ask again: do you want to update the -whole- page or just part of it?
0
 
LVL 1

Author Closing Comment

by:craigdev
ID: 31467774
I see your point, thanks
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
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 …

776 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