Interviews4 answers
What is the main difference between @Html.Partial and @Html.RenderPartial in MVC Asp.net?
4 Answers
@Html.Partial is a return type and can store return value to a string.
@Html.RenderPartial is a no return type. it is a void. It directly execute where we call inside normal view.
Vignesh ManiPosted Jun 19, 2015, 4:57 AM EDT
@Html.Partial("partialviewname")--> returns MVC HTML string.
@Html.RenderPartial("partialviewname")-->return type will be void(changes will not effect).
Sreekanth ReddyPosted Jun 16, 2015, 10:00 AM EDT
http://stackoverflow.com/questions/5248183/html-partial-vs-html-renderpartial-html-action-vs-html-renderaction
Khan Abrar AhmedPosted Jun 16, 2015, 3:02 AM EDT
@Html.Partial as HTML code copied into the parent page and @Html.RenderPartial as an .ascx user control incorporated into the parent page.
'@Html.Partial' returns a html encoded string that gets constructed inline with the parent. It accesses the parent's model.
'@Html.RenderPartial' returns the equivalent of a .ascx user control. It gets its own copy of the page's ViewDataDictionary and changes made to the RenderPartial's ViewData do not effect the parent's ViewData.
Sanjay SabariyaPosted May 21, 2015, 11:02 PM EDT



