I would like to cancel a task using a cancellation token as described here: http://msdn.microsoft.com/en-us/library/dd997396.aspx.
The only difference is that:
I would like to start a task when I browse to a specific controller/Action, and cancel the task(tokenSource.Cancel()) to be called when I LEAVE, browse away from that specific action (page) I’m currently on. How would i do it? Thanks
I figured it out.
I wrote a custom Attribute Filter that does this. Then in the code I have the following: