Difference between Html.RenderAction and Html.Action

99封情书 提交于 2019-12-17 06:12:52

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/2955261/difference-between-html-renderaction-and-html-action

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!