Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

后端 未结 13 776
感动是毒
感动是毒 2020-11-22 04:03

In ASP.NET MVC, what is the difference between:

  • Html.Partial and Html.RenderPartial
  • Html.Action and Html.
13条回答
  •  隐瞒了意图╮
    2020-11-22 04:12

    Partial or RenderPartial: No need to create action method. use when data to be display on the partial view is already present in model of current page.

    Action or RenderAction: Requires child action method. use when data to display on the view has independent model.

提交回复
热议问题