Can someone explain what RenderBody() does in detail. I am new to MVC.
<!DOCTYPE html>
@RenderBody()
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Sunny SharmaRank #223 · 11.1K pointsPosted Sep 15, 2013, 2:51 AM EDT
@RenderBody() is a helper method in ASP.NET MVC and is very similar to <asp:ContentPlaceholder> tag in ASP.NET master pages.
@RenderBody() renders portion of a content page which that is not within a named section. ASP.NET MVC also provides @RenderPage() & @RenderSection() helper methods to render content of a page in other page and render the content of a named section respectively.
I suggest you to visit here: http://www.w3schools.com/aspnet/mvc_htmlhelpers.asp
This will give you more insight on the topic.
Hope it helps :)