tags:

views:

51

answers:

2

Hello all,

I have an asp.net update web app. Users go the the page, hit the update button and the program runs. We also want this program to run as a scheduled task everynight. Is this possible? How would you handle this?

thanks

+2  A: 

You could create a shortcut on your program to a page on your web app (say update.aspx?command=update) and then have your server's scheduler set to run that shortcut at the time you wish.

I would only recommend that you use a page which has nothing on it and will only respond to a specific command, that way you lower the risk of your page being "tripped" when you don't want it to be.

TheTXI
Note: This is how one of my company's web apps work right now for sending out email notifications for items that have to be checked every day. The web app has a special page called notify.aspx and it will do nothing unless it is passed the specific querystring command via the shortcut on the server.
TheTXI
+1  A: 

A better way would be to break the application up into a domain layer dll, then your aspx page could use that dll, and you could also write a console app that used the same dll. You could setup a scheduled task to run the console app nightly.

Jason