Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

后端 未结 13 804
感动是毒
感动是毒 2020-11-22 04:03

In ASP.NET MVC, what is the difference between:

  • Html.Partial and Html.RenderPartial
  • Html.Action and Html.
13条回答
  •  一生所求
    2020-11-22 04:22

    @Html.Partial returns view in HTML-encoded string and use same view TextWriter object. @Html.RenderPartial this method return void. @Html.RenderPartial is faster than @Html.Partial

    The syntax for PartialView:

     [HttpGet] 
     public ActionResult AnyActionMethod
     {
         return PartialView();
     }
    

提交回复
热议问题