Difference between RenderBody, RenderPage and RenderSection in ASP.NET MVC
The RenderBody can generally be found in the Layout page which is a kind of master page. Each Layout page can contain only one RenderBody method. It is like a Content Placeholder in ASP.NET WebForms.
With the RenderPage, the content of the page can be filled by other pages. This takes the physical path of the file.
@RenderPage ("~/Page1.cshtml")
With the RenderBody method, you can have only one RenderBody in a page but a Layout page can contain more than one RenderSection method. The RenderSection runs the code that are defined in the content pages.
Leave a Reply