I am building a solution with Sitecore 7 and ASP.NET-MVC 3 and trying to use a custom model class as described in this blog post by john west.
I have seen several other questions here on SO reporting a similar error with ASP.NET-MVC (without Sitecore), usually related to passing the wrong type of object in controller code, or there being a configuration error with the \Views\web.config
file, but neither seem to be the issue here.
This error can be caused when a controller rendering invokes a controller method which returns an ActionResult
object instead of a PartialViewResult
. In my case I had a rendering model associated with the layout which I believe Sitecore was trying to pass to my controller rendering.