I was trying to apply AsyncTimeout attribute on my Async aciton of a Async controller. It looks like not able to produce a TimeoutException. Does anyone know how to use this attribute?
Here is my sample code for testing this attribute:
using System;
using System.Web.Mvc;
using System.Threading;
namespace MvcApplication1.Controllers
{
public class HomeController : AsyncController
{
[AsyncTimeout(2)]
public void IndexAsync()
{
Thread.Sleep(3000);
}
public ActionResult IndexCompleted()
{
return View();
}
}
}
Doggy8088
Member
41 Points
110 Posts
The AsyncTimeout filter doesn't works
Jun 01, 2010 06:41 PM|LINK
I was trying to apply AsyncTimeout attribute on my Async aciton of a Async controller. It looks like not able to produce a TimeoutException. Does anyone know how to use this attribute?
Here is my sample code for testing this attribute:
using System; using System.Web.Mvc; using System.Threading; namespace MvcApplication1.Controllers { public class HomeController : AsyncController { [AsyncTimeout(2)] public void IndexAsync() { Thread.Sleep(3000); } public ActionResult IndexCompleted() { return View(); } } }http://blog.miniasp.com/