In the snippet above, both calls will yield the same result.
While one can store the output of Html.Partialin a variable or return it from a method, one cannot do this with Html.RenderPartial. The result will be written to the Response stream during execution/evaluation.
This also applies to Html.Actionand Html.RenderAction.
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Html.Partial returns a String, Html.RenderPartial calls write internally, and returns void.
The basic usage is.
In the snippet above, both calls will yield the same result.
While one can store the output of Html.Partial in a variable or return it from a method, one cannot do this with Html.RenderPartial. The result will be written to the Response stream during execution/evaluation.
This also applies to Html.Action and Html.RenderAction.