Difference between Html.RenderAction and Html.Action

前端 未结 2 1789
萌比男神i
萌比男神i 2020-11-28 12:44

Does anybody know what\'s the difference between Html.RenderAction and Html.Action?

相关标签:
2条回答
  • 2020-11-28 13:10

    Html.Action() – Outputs string

    Html.RenderAction() – Renders directly to response stream

    If the action returns a large amount of HTML, then rendering directly to the response stream provides better performance than outputting a string.

    0 讨论(0)
  • 2020-11-28 13:15

    The difference between the two is that Html.RenderAction will render the result directly to the Response (which is more efficient if the action returns a large amount of HTML) whereas Html.Action returns a string with the result.

    check out this link for a detailed explanation

    0 讨论(0)
提交回复
热议问题