What is the difference between Partial() and RenderPartial() Methods of Html Helper?

Forums C#What is the difference between Partial() and RenderPartial() Methods of Html Helper?
Staff asked 2 years ago

What is the difference between Partial() and RenderPartial() Methods of Html Helper? Which one is best to use?

Answers (1)

Add Answer
Nishant Kakadiya Marked As Accepted
Staff answered 2 years ago
  1. Html.Partial returns HTML string and Html.RenderPartial always returns void.
  2. Html.Partial add the HTML string of the partial view into the main view and Html.RenderPartial directly writes HTML in the response stream.

Subscribe

Select Categories