ExtensionsFactory.GetStyleSheets(StyleSheet[]) Method
Renders the specified style sheets in the response.
Namespace: DevExpress.Web.Mvc.UI
Assembly: DevExpress.Web.Mvc5.v18.2.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
cssItems | StyleSheet[] | An array of StyleSheet objects defining the attached style sheets. |
Returns
Type | Description |
---|---|
MvcHtmlString | An MvcHtmlString object that is an empty string. |
Remarks
The GetStyleSheets method is used to attach the necessary stylesheet files of the desired DevExpress theme. This method should be called within the HEAD tag of view pages (in most cases, it’s reasonable to call it within the Site.Master or Layout page).
Note
The GetStyleSheets method is analogous to the ExtensionsFactory.RenderStyleSheets method and is oriented for use in MVC Razor projects. The GetStyleSheets just renders style sheets to the response and returns an empty string for consistency with Razor syntax.
See Using Extensions in Razor Views to learn more.
Example
The following code attaches DevExpress stylesheets to provide the default appearance for DevExpress extensions.
<html>
<head>
...
@Html.DevExpress().GetStyleSheets(
new StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
new StyleSheet { ExtensionSuite = ExtensionSuite.Editors },
new StyleSheet { ExtensionSuite = ExtensionSuite.HtmlEditor },
new StyleSheet { ExtensionSuite = ExtensionSuite.GridView },
new StyleSheet { ExtensionSuite = ExtensionSuite.Chart },
new StyleSheet { ExtensionSuite = ExtensionSuite.Report }
)
</head>
...
</html>