Solved

AJAX Timer1

Posted on 2008-06-16
6
423 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
Comment Utility
what is it you're trying to do?
0
 
LVL 1

Author Comment

by:craigdev
Comment Utility
refresh a progress screen every 5 seconds
0
 
LVL 6

Expert Comment

by:cottsak
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:craigdev
Comment Utility
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
Comment Utility
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
Comment Utility
I see your point, thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Add json string to a javascript object 9 47
Azure Web App - See files 3 21
Using MS Code on my Mac 6 44
Paging GridView 7 32
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now