Difference between Html.Partial() and Html.RenderPartial() in ASP.NET MVC:
Html.Partial() | Html.RenderPartial() |
---|---|
Html.Partial returns html string. | Html.RenderPartial returns void. |
Html.Partial injects html string of the partial view into main view. | Html.RenderPartial writes html in response stream. |
Performance is slow. | Perform faster than HtmlPartial(). |
Html.Partial() need not to be inside the braces. | Html.RenderPartial must be inside braces @{ }. |