Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have few aspx pages connected to master page.
on each content page i am running asp timer now when timer finishes i have written some action on the tick event . Now the problem is that when the page load of perticular page occurs then and only then tick event fires . here i want all the timers of respective pages to perform their action irrespective of their page load event means whether i redirect to perticular page or not.
to be frank database updation should occur irrespective of page load means without loading perticular page. pls help me out with this as early as possible
Posted
Updated 31-Dec-13 1:32am
v2

You have different options to handle it but it depends on your requirement.

One of those , Tadit has already suggested which uses Global.asax application event for the periodical DB updates. But can go through the link about the risk involved

http://haacked.com/archive/2011/10/16/the-dangers-of-implementing-recurring-background-tasks-in-asp-net.aspx/[^]

Even implementing IHttpModule interface will can be helpful.

Or other option is to use timer in Masterpage .

May be one more option is to have a webservice and add a windows service to schedule the updations periodically.
http://msdn.microsoft.com/en-us/magazine/cc163821.aspx[^]

Hope this helps you...
 
Share this answer
 
Store that in Session. Then you will be able to use it in all the Pages.
 
Share this answer
 
Comments
ank170989 31-Dec-13 7:42am    
you didn't get me .pls see this article i am facing the same problem but not able to understand the solution .
http://stackoverflow.com/questions/9016352/countinue-the-timer-even-after-transfer-to-another-page

how to store it in session means tick event.
Okay, then use Global.asax and do your task there. Can't you?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900