Resource not found in asp.net mvc AsyncController
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 insta开发者_Go百科nce from the IoC container, does it need to wire up the AsyncHttpHandler has well? Can anyone drop some hints?
thanks in advance.
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.)
精彩评论