Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timercontrol not 'firing'

Status
Not open for further replies.

JRB-Bldr

Programmer
May 17, 2001
3,281
0
0
US
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
 
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
 
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="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<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
 
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 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:
Thanks,
JRB-Bldr
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top