1

I have pretty weird question. In my ASP.NET MVC application I defined 1 Timer which is ticking every X minutes for purpose of doing some repeating task. First of all I know that this is not best practice, but for my demo I cannot use task schedulers, windows service or something similar so I'm using this approach.

I declared static Timer in my global.asax and initialized it in Application_Start() method. Every event tick of timer I need to call one of my Controllers Action method? Is this possible to do from global.asax and if it is, how? Using webrequest? Something else?

If you have any other approach it would be great. The main task is to have some repeating task in background over my web application but using Timer.

rjovic
  • 1,207
  • 2
  • 16
  • 37

1 Answers1

2

Is this possible to do from global.asax and if it is, how? Using webrequest? Something else?

Yes, WebRequest is the way to go or a WebClient since it's easier to use.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928