Shared Layout in MVC .NET 6   | Lecture 07

Shared Layout in MVC .NET 6 | Lecture 07

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.