Razor: @Html.Partial() vs @RenderPage()

后端 未结 5 774
误落风尘
误落风尘 2020-11-30 20:02

What is the appropriate way of rendering a child template?

And what\'s the difference? Both seem to work for me.

And why does @Html.RenderPartial()

5条回答
  •  一生所求
    2020-11-30 20:52

    @RenderPages() 
    

    The above does not work in ASP.NET MVC. It only works in WebPages.

    @Html.Partial("_Footer")
    

    You will need to use the above in ASP.NET MVC.

提交回复
热议问题