Search code examples
asp.netasp.net-mvc-4sections

What is the purpose of compulsory sections?


I understand the benefit of required: false sections in MVC4. They are simply optional parts of a layout that will not display if the View does not contain them. But what is the benefit of required: true sections? Shouldn't something in a required: true section simply be put directly into the layout itself?


Solution

  • Just as an example, you could have a menu that would be required for each page but would also differ between controllers and/or areas.