Difference between Partial and RenderPartial Html Helpers

Html.Partial()

  • Return type is MvcHtmlString (HTML- encoded string).
  • As return type is string we can store output result in a variable and we can also manipulate.
  • Syntax Declaration : @Html.Partial(“_Employee”)

Html.RenderPartial()

  • Return type is void.
  • As return type is void we cannot store it in a variable.
  • Syntax Declaration : @{ Html.RenderPartial(“_Employee”) ; }
  • From Performance prospective this method is faster than partial() method because its result is directly return to the output stream so which makes it fast.


Subscribe

Receive Quality Tutorials Straight in your Inbox by submitting your Email below:

Delivered by FeedBurner

Protected by Copyscape Duplicate Content Checker