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

后端 未结 13 988
感动是毒
感动是毒 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:11

    For "partial" I always use it as follows:

    If there's something you need to include in a page that you need to go via the controller (like you would with an Ajax call) then use "Html.RenderPartial".

    If you have a 'static' include that isn't linked to a controller per-se and just in the 'shared' folder for example, use "HTML.partial"

提交回复
热议问题