Search code examples
c#asp.netajaxtimer

How to tell if an ajax timer has gone off at page_load


I have a web application and I'm attempting to put an ajax timer control in it to give me a post back every 10-20 seconds. (possibly longer depending on performance). I have a lot of dynamically created each with auto postback. These controls are inside of their own update panel.

Well, whenever an AJAX timer tick happens, I want to be able to know this at page_load so that I can have some conditions off of this(such as not creating some controls or whatever).

So how can I know at Page_Load time that the reason for the post back was a tick event? I have tried doing something like if(Request.Form[mytimer.UniqueID]!=null) but that is always a false condition(it is always null)

Basically, I just want to know if an AJAX timer tick event will happen, before the event actually occurs(which is after page_load)


Solution

  • I think this is what your looking for:

    http://geekswithblogs.net/mahesh/archive/2006/06/27/83264.aspx

    The article explains how to figure out which control caused the post back which in your case would be your timer control.