Skip to content

RenderBody()

David Smith

Asked Sep 14, 2013, 4:25 PM EDT1 answer
Share
LinkedInX
MVC 4


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.

  • Sunny  Sharma
    0
    Hi David,

    @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 :)
    0