Feather: Use sections for resources
Using CSS styling, JavaScript logic, and jQuery support is a part of the process of developing your MVC views. Placing your resources in the correct sections of the page is important. For example, a good practice is to place your stylesheets in the <head> tag and the scripts before the closing <body> tag.
Feather provides you with full control on where to place your resources. For this purpose, you can register sections in your layout files. Thus, when using the @Html.Section method, you can define where to insert your resource on the page. @Html is an ASP.NET MVC helper method. For more information, see HTMLHelper methods. Section
method is part of the Feather helper methods inside the Telerik.Sitefinity.Frontend
assembly.
Register a Feather section
You can place the section anywhere on your layout file. Afterwards it will be replaced by all referenced resources for that section. The following code creates a new section:
Regardless of the position of the resources, registered via the @Html.Script
and @Html.StyleSheet
helper methods, they will be rendered inside this section. This means that you can register resources above the section and still have them in the correct place when the page is rendered.
For more information, see Feather: Refer to resources inside views.
NOTE: If a resource is registered to render in a specific section and this section is afterwards renamed or deleted, the resource registration will throw an exception.
Default Feather sections
If you use the standard feather resource packages, the following sections are available out-of-the-box:
head
Just before the closing head tag
top
Just after the opening body tag
bottom
Just before the closing body tag
IMPORTANT: We recommend not to remove those sections.