开发者

ASP.NET MVC AsyncController xxxCompleted

When implementing ASP.NET MVC AsyncController the xxxCompleted method has to be Public. I'm wondering if this means the xxxCompleted method can be invoked directly, or if this 开发者_JAVA百科is protected internally using NonAction or something similar?

Thanks.


Internally (and simplistically), there's an array of MethodInfo of the actions on the async controller constructed. When it's constructed the Async and Completed suffixes are stripped off the action method names.

If you try an call an action method such as IndexCompleted this array is searched but because there isn't an IndexCompleted in the array (because the suffixes have been removed) the AsyncControllerActionInvoker reports that no action was found.

It's worth having a poke around the source code to see for yourself:

ASP.NET MVC 2 RTM on CodePlex

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜