Reputation: 1169
So I have read this question (Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction) and understand what Html.Partial and Html.Action do.
But I am trying to understand why these were introduced. Could you please explain a scenario where I would want to get back a MvcHtmlString instead of writing it out to the response stream? I am sure there is a big use case for this.
Thanks!
Upvotes: 0
Views: 223
Reputation: 34523
Having MvcHtmlString gives you more flexibility. You may modify it before using or store it to avoid complex rerendering.
Upvotes: 1