Last post Jul 16, 2017 12:42 AM by bruce (sqlwork.com)
Jul 15, 2017 08:17 PMemail@example.com|LINK
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:
Things that would probably work but I would prefer not to do:
What would be the correct approach?
Jul 15, 2017 09:40 PM|maherjendoubi|LINK
Common HTML structures such as scripts and stylesheets are also frequently used by many pages within an
app. All of these shared elements may be defined in a layout
file, which can then be referenced by any view used
within the app. Layouts reduce duplicate code in views, helping them follow the
Don't Repeat Yourself (DRY)
Jul 15, 2017 10:14 PMfirstname.lastname@example.org|LINK
Hello, I am trying to share @sections. Can you provide an example how to use a @section defined in the Layout file?
Jul 16, 2017 12:42 AM|bruce (sqlwork.com)|LINK
custom taghelper are probably the correct solution: