In order to use @section Styles
, you layout being used by the view must include
@RenderSection("styles", false)
@RenderSection
acts as a placeholder in the layout to render any content that has been defined in in the section. In your case in means that the css files defined in the iCheckStyles
bundle will be rendered at the point in the view where @RenderSection
is declared. For css files, this would typically be in the <head>
tags immediately before @Scripts.Render("~/bundles/modernizr")
Note the second parameter defines whether the view requires a @section Styles { ... }
. If the value is false
, then @section Styles
is optional, other wise the view must include @section Styles
or an exception will be thrown.