#10 RenderSection Method in Layout

In layout Pages,renders the content of named Section.

RenderSection("footer",false) ---If set to false,then view need not have a section

The above code expects the Section “footer” to be used and its mandatory,so typically view must have a section named footer.

{
    Layout = ~/Views/Shared/_Layout.cshtml;
}
section footer
{
This is sample footer
}

Working principle of RenderSection :

rendersection

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s