ASP.NET MVC - Can a Partial View have a controller?
问题 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? 回答1: Probably it will be better to use the RenderAction instead of the RenderPartial 回答2: You should gather all data necessary for the partial in the current controller action (which may use methods shared across other controllers and actions). If you really want a partial to be rendered using its own controller