I'm building an ASP.Net MVC 2 application with a component architecture. There are two different types of components: Elementary Components, which have an associated controller action rendering a partial view, and Layout Components, which render all their child components (Elementary Components or again Layouts) in a certain layout.

When I tried to render an example layout component with three associated elementary child components, the page wouldn't render. Some debugging revealed the following problem:

RenderComponent(5) renders the layout view.
For rendering the first child component in the layout, Html.RenderAction("RenderComponent", "Core", 1) is called in the view. Stepping further, I discovered that in effect RenderComponent(5) is called instead of RenderComponent(1)!!

This obviously results in an infinite loop of the layout view rendering itself.

Why is this happening? How can I fix it? Is my hierarchical component architecture incompatible with ASP.Net MVC? How would you build such a system in ASP.Net MVC?