How can i make a schedule in asp.net mvc?
I'm looking for a scheduler for asp.net mvc. For example I want to send notification开发者_StackOverflow社区 email weekly and also check expired date of the contract. Please suggest me solution in asp.net mvc. Thanks in advance.
You may checkout Quartz.NET.
For scheduling functions, you might be better off using a Windows Service or a console app which is kicked-off by a scheduled task, rather than a web app. Web applications work best by responding to immediate inputs, and are not usually suited for handling actions that must start on their own. If you try to run a scheduling service as a background thread in a web app, you may run into problems when the app pool is recycled, or if IIS decides to kill your thread.
In any case, like Darin said, Quartz.NET is a good open source scheduling framework.
Have a look at my answer to the same question:
Scheduler for ASP.NET?
For the non-critical scheduled tasks you can definitely use Quartz.NET from your ASP.NET MVC project but you need to be sure to keep application alive most of the time what is not the case for the low traffic websites.
To keep application alive you can use http://www.uptimerobot.com/ which will ping your app every 5 minutes and also you will get site monitoring with it.
Look at the blog post for the simple example. http://asmiki.wordpress.com/2011/05/25/using-quartz-net-enterprise-scheduler-to-schedule-jobs-in-asp-net-mvc-application/
精彩评论