Scheduled Tasks in ASP.NET Web Applications using Timers

Most of the ASP.NET Web Developers who have their Web application hosted in Shared hosting, do not have much control over the hosting server including having the ability of creating Window Services or create their application specific scheduled tasks.


Recently, while going through the Community Starter Kit code, I found a nice way (basic) of having a timer in the Global.asx Application_Start event as below:
 


The code in Fig (1) makes a call to a Web Service and this is quite useful and even powerful for small to medium size Web sites, especially if that call is Asynchronous.


Other issues could arise are error handling and performance.

 

Published Saturday, May 09, 2009 9:16 AM by ausideveloper
Filed under: , , ,

Comments

# re: Scheduled Tasks in ASP.NET Web Applications using Timers

Sunday, August 23, 2009 7:59 AM by Ketan

should it required to application start every time ?  

# re: Scheduled Tasks in ASP.NET Web Applications using Timers

Saturday, June 19, 2010 2:02 AM by Ranjan Pati

I need to run a perticular page at 4.30 am every day. Then with this code who can i call the .aspx page ???

Plz reply me

my id: urs.ranjanpati@gmail.com

# re: Scheduled Tasks in ASP.NET Web Applications using Timers

Wednesday, September 15, 2010 7:37 AM by stapes

Trying this. Will not compile.

Error 1 The name 'CommunityGlobals' does not exist in the current context C:\Inetpub\wwwroot\OceanLED\Global.asax 7 13 C:\...\OceanLED\

Error 2 The name 'ServiceUtility' does not exist in the current context C:\Inetpub\wwwroot\OceanLED\Global.asax 22 9 C:\...\OceanLED\

Leave a Comment

(required) 
(required) 
(optional)
(required)