RenderAction not finding action method in current controller in current area

Posted by Andrew Davey on Stack Overflow See other posts from Stack Overflow or by Andrew Davey
Published on 2010-03-15T14:59:28Z Indexed on 2010/04/12 6:33 UTC
Read the original article Hit count: 528

I'm creating an ASP.NET MVC 2 (RTM) project that uses areas. The Index action of the Home controller of one area needs to use RenderAction to generate a sub-section of the page. The action called is also defined in the same Home controller. So the call should just be:

<% Html.RenderAction("List") %>

However, I get an exception:

A public action method 'List' was not found on controller 'RareBridge.Web.Areas.Events.Controllers.HomeController'.

Note that I'm not in the "Events" area! I'm in a completely different area. If I remove the "Events" home controller, then the exception still occurs but names a different controller (still not the one I want it to call).

I've also tried providing the controller name and area to the RenderAction method, but the same exception occurs. What is going on here?

BTW: I am using Autofac as my IoC container

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about ASP.NET