Other than the type it returns and the fact that you call it differently of course
<% Html.RenderPartial(...); %>
<%= Html.Partial(...) %>
This is a great explanation by Dino Esposito:
The difference between the two methods may look small and harmless, but it may bite at you if you don’t know how to handle it. The key difference between the two methods is:
Partialreturns a HTML-encoded stringRenderPartialis a void method that writes directly to the response output stream.The usage of the two methods is slightly different:
@Html.Partial("_yourPartialView") @{ Html.RenderPartial("_yourPartialView "); }The choice of which to use depends on your requirements. If you need to further manipulate the string being injected in the response stream, you should use
Partial; otherwise go withRenderPartialwhich is-just because it goes straight to the stream-a little faster thanPartial.In the end, the use-cases for partial views fall in either of two camps. The first is when you create a view by composing together various independent pieces of markup, as below.
@{ Html.RenderPartial("_Header"); } @Html.Partial("_Sidebar")@RenderBody()@{ Html.RenderPartial("_Footer"); }In this case, your decision in choosing between
RenderPartialorPartialdoesn’t change the final effect. However, becauseRenderPartialis slightly faster, you may prefer using it.