IMPORTANT: This version of Sitefinity CMS is out of support and the respective product documentation is no longer maintained and can be outdated. Use the version selector to view a supported product version.
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.
Section
Telerik.Sitefinity.Frontend
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:
@Html.Section("main")
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.
@Html.Script
@Html.StyleSheet
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.
If you use the standard feather resource packages, the following sections are available out-of-the-box:
head
top
bottom
IMPORTANT: We recommend not to remove those sections.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important