Hi!
I am trying to share a piece of HTML (2nd level links) among views of one controller. I tried to put RenderSection in the _Layout.cshtml and then:
- @section HomeSection in _ViewStart.cshtml placed Views/Home, wasn't found
- @section HomeSection into _Layout.cshtml, wasn't found
Things that would probably work but I would prefer not to do:
- Duplicate the layout in _Layout file into multiple files with small tweaks and set the layout in Views/Home/_ViewStart.cshtml
- Use RenderPartial and create heap of separate files in Views/Shared, for every section shared
- Move one level up from Controller-View to Area-Controller with single action and section per view
What would be the correct approach?
Thanks,
Jan