views:

37

answers:

1

Hi,

I just converted a my controller to asyncController in asp.net mvc 2. (ie: spliting action method About into AboutAsync and AboutCompleted). However, I am getting a resource not found error.

My route table has not change and the only reason I can think of is because I am mvcextension project. Since it does it's own wiring of controllerFactory and creates instance from the IoC container, does it need to wire up the AsyncHttpHandler has well? Can anyone drop some hints?

thanks in advance.

+2  A: 

A few notes for things to check for, in order:

  • Make sure your controller subclasses AsyncController rather than simply Controller.
  • The URL to hit HomeController::AboutAsync()/AboutCompleted() should be /Home/About (the Async isn't part of the URL)
  • If you're using a custom invoker, it must subclass AsyncControllerActionInvoker (or implement IAsyncControllerActionInvoker) rather than subclass ControllerActionInvoker directly
  • Make sure that you're hooking the MvcRouteHandler up to Routing (which should be the default behavior of MapRoute). If you're using a custom IRouteHandler, make sure that its GetHttpHandler() method is returning an MvcHandler. (Note - you should not subclass MvcHandler.)
Levi
@Levi: "If you're using a custom invoker, it must subclass AsyncControllerActionInvoker (or implement IAsyncControllerActionInvoker) rather than subclass ControllerActionInvoker directly"This is right on!!! Thanks to open source, I can not only fix this problem myself and also put in a patch!
Herman