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 months ago

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

Answers (1)

Add Answer
Faisal Pathan Marked As Accepted
Staff answered 2 months 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