4
Reply

What is the main difference between @Html.Partial and @Html.RenderPartial in MVC Asp.net?

Sanjay Sabariya

Sanjay Sabariya

May 22, 2015
1.8k
0

    @Html.Partial is a return type and can store return value to a [email protected] is a no return type. it is a void. It directly execute where we call inside normal view.

    Vignesh Mani
    June 19, 2015
    2

    @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 Sabariya
    May 22, 2015
    1

    @Html.Partial("partialviewname")--> returns MVC HTML [email protected]("partialviewname")-->return type will be void(changes will not effect).

    Srikanth Reddy
    June 16, 2015
    0

    http://stackoverflow.com/questions/5248183/html-partial-vs-html-renderpartial-html-action-vs-html-renderaction

    Khan Abrar Ahmed
    June 16, 2015
    0