Take the 2-minute tour ×

I want to Scheduling in Asp.net

I have following options to implement this

  1. To write SQLServer JOB(I dont want to do this.Dont want to go outside of .Net environment)

  2. Second option is I will write windows service and this window service will call asp.net webservice then this webservice calls asp.net method
    (I also dont need to do this because my hosting provider might not be allow me to install window service)

  3. Third option is I call my scheduling method in Application_Start event in global class (Drawback is, webserver will kill thread any time )

  4. To call Scheduling Code in Page_Load event of Home Page(Might be nobody visits my website for hours ,Also page execution might be slow due to scheduling code)

  5. I also found some online services that calls your page at given interval,some are given below

    http://www.cronservice.co.uk/new/ http://scheduler.codeeffects.com

Anybody give me bettor solution of this and also explain why it is bettor?

Thanks in Advance

share|improve this question
What about an executable run by windows task scheduler? –  jrummell May 1 '12 at 14:55
Might be Hosting provider not allow this –  fihsak May 1 '12 at 14:58
I will host website on shared hosting environments –  fihsak May 1 '12 at 15:00
add comment

6 Answers

up vote 4 down vote accepted

The ASP.NET application isn't the right place to implement scheduling. I would suggest creating a service or a scheduled task that runs in short intervals.

share|improve this answer
add comment

There is no one solution that fits all. SQL jobs and windows jobs (scheduled thru windows task scheduler) are very widely used. In one of my previous work places they had jobs that ran on multiple platforms (mainframe,windows,sql server). Failure in some of these jobs, would cost in thousands by the day. So they employed something called ESP. This software monitored jobs on all platforms and sent a message to the control room in case of a failure.

If you throw some more light on the requirement, we might be able to help you better.

share|improve this answer
add comment

ASP.NET is not the right place to house your Scheduled Tasks. I'm using Quartz.net when I have to create Scheduled Tasks.

share|improve this answer
add comment

Create a page that launches your task and place it at the URL http://www.mydomain.com/runtask.

Create a scheduled task on your home PC that sends a request to http://www.mydomain.com/runtask.

You'll need to keep your home PC on all the time.

share|improve this answer
add comment

You don't have many options in a shared hosting environment. My host (WinHost) allows remote access to their database, so I was able to create an executable that ran on a local server with Task Scheduler.

The performance isn't great since the database is accessed over the internet, but it's still better than attempting to run pseudo scheduled tasks with ASP.NET.

Some hosts also offer a service that will request a url within your site on a scheduled basis. However, this didn't work for me because the task I had to run took longer than the request timeout.

share|improve this answer
add comment

Ideally I would go with number 1 as you get full control/history/error reporting etc. You can write an SSIS job in .NET and have SQL server schedule it.

However, I have had a similar problem with shared hosting that is very restrictive. What I did was create a page which runs the process on page load (using validation in the querystring for security). I then used a machine I have which is always on to schedule a Windows Task Scheduler (this is part of Windows as standard) to call a bit of VB script that opens the browser and then shuts it.

share|improve this answer
add comment

Your Answer


