English 中文(简体)
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)

最佳回答

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.

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签