Using @section Inside Razor Helper
We are trying to setup Sections of our layout to be Required but configurable based on the individual page. At the moment we do this with a Section. @section FloatingNav { <
Solution 1:
I don't think this is possible.
The @helper
and @section
syntax are special directives for compiling pages.
A HelperResult
(a helper) doesn't know how to define a section.
The DefineSection method belongs to a WebPageBase
.
You might have to come at this from a different direction. Using partial views instead of helpers would probably fix this problem.
Post a Comment for "Using @section Inside Razor Helper"