ASP.NET MVC - Can a Partial View have a controller?

dev.e.loper picture dev.e.loper · Jul 5, 2011 · Viewed 7k times · Source

When I'm in a View and I call @Html.RenderPartial("MyPartialView", MyObject) Can I set it up so that this partial view has a controller which is called when RenderPartial gets called?

Answer

Mikhail picture Mikhail · Jul 5, 2011

Probably it will be better to use the RenderAction instead of the RenderPartial