INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Timercontrol not 'firing'

Timercontrol not 'firing'

(OP)
Hello,

I am beginning to try using AJAX with my ASP.Net page.
Rather than wondering why my UPADATEPANEL is not appearing, I am trying to break things down to the basics.

I have a Timercontrol object placed OUTSIDE of my Updatepanel and it is set for Interval = 2000 (2 seconds between 'ticks')
Within my VB.Net code I have a Breakpoint set within the TimerControl_Tick() event, but it never 'hits' when I run the code.

Obviously I need to get this running reliably before I can even Hope to get the Updatepanel working (since I want this updated with the Timer Tick method)

Any advice/suggestions you might have that can help me getting the TimerControl to 'fire' would be greatly appreciated.

Thanks,
JRB-Bldr

RE: Timercontrol not 'firing'

(OP)
I'll add another piece of information....

Since I read that when the Timer 'ticks' it will cause a Post_back, I put a breakpoint into the Page_Load event and looked for it to be executed "on its own" due to a Timer 'tick'.

I never saw that happening either.

Thanks,
JRB-Bldr

RE: Timercontrol not 'firing'

There must be something else on the page causing an issue. Have you tried using FireBug to see if a js error is being thrown?

I did a simple test page and this worked for me:

CODE

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager runat="server"></asp:ScriptManager>
        <asp:Timer ID="Timer1" runat="server" Interval="2000">
        </asp:Timer>
    
    </div>
    </form>
</body>
</html> 

And in the code behind, I simply put this:

CODE

Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Response.Write(DateTime.Now())
    End Sub 

RE: Timercontrol not 'firing'

(OP)
Thank you for your reply.

Yes, I have tried using Firebug.
Although it is possiblly not in the manner correct to identify the problem.

I generally use Firebug to identify BASIC javascript syntax errors where the Console tab clearly shows them to you.
There are none of those appearing.

Throughout my web reference reading to find a solution I find references to Web.Config issues (I DON'T THINK I HAVE ANY OF THOSE)
And other issues like ScriptManager issues such as needing to Register the Timer:
ScriptManager1.RegisterAsyncPostBackControl(UpdtTimer)
Again, I tried that and it did not resolve anything.

In case you want to look it over I have posted what I thought was the pertinent pieces of the code at: thread1600-1743086: AJAX UPDATEPANEL ProgressBar with external TimerControl not working where I hoped to find someone with the MAGIC CURE - possibly through some esoteric AJAX setting that I have overlooked.

Also, as an FYI, the model that I am more-or-less trying to implement (right or wrongly) is at: http://www.codeproject.com/Articles/18877/Progress...

Thanks,
JRB-Bldr





RE: Timercontrol not 'firing'

(OP)
I have found my answer by creating a VERY SIMPLE version of an ASP web page and tested.

The timer was working, but it was not outputting the expected results to the Updatepanel object.
Within the Timer.Tick event I was examining a SESSION variable and 'deciding' what to do.

This SESSION variable was being re-set to a default value in the Page_Load event due to not having put it into a IF/END IF condition.

Thanks,
JRB-Bldr

RE: Timercontrol not 'firing'

excellent, glad you found the issue.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close