Shared Layout in MVC .NET 6   | Lecture 07

Shared Layout in MVC .NET 6 | Lecture 07

Hammad Maqbool's photo
Hammad Maqbool
·Feb 25, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Video Lecture on the Topic

When you create a website / Web Application all which may have 5 or let say 10 web pages possibly all the pages will share the same navigation bar, header and footer. When these things are same copy and pasting the whole code of the above mentioned things on every page is a bad idea..

Thats where shared layout come to serve you all the things which you want to repeat on every page, You put all of those things on the shared layout page under the Views/Shared section and where you want all the other pages to render under the shared layout page you simply write the function name RenderBody() there.

 
Share this