ASP.NET MVC - 局部视图可以有一个控制器?
问题描述:
当我在查看和我称之为 @ Html.RenderPartial(MyPartialView,为MyObject)
我可以设定,让这部分观点有一个控制器当的RenderPartial被调用它叫什么名字?
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?
答
也许这将更好地使用RenderAction而不是在的RenderPartial
Probably it will be better to use the RenderAction instead of the RenderPartial