ExtensionsFactory.GetStyleSheets(String, StyleSheet[]) Method

Renders the specified style sheets in the response.

Namespace: DevExpress.Web.Mvc.UI

Assembly: DevExpress.Web.Mvc5.v20.2.dll

Declaration

public MvcHtmlString GetStyleSheets(
    string clientUIControlColorScheme,
    params StyleSheet[] cssItems
)
Public Function GetStyleSheets(
    clientUIControlColorScheme As String,
    ParamArray cssItems As StyleSheet()
) As MvcHtmlString

Parameters

Name Type Description
clientUIControlColorScheme String

A string value specifying the color scheme for client controls ("light" or "dark").

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 in the Site.Master or Layout page).

IMPORTANT

Attach all required style sheets within one GetStyleSheets method call.

Every extension suite has its own set of required style sheets. Their optimization in performed inside the GetStyleSheets method. If you call the method several times, it can cause the style sheet duplication and as a result an incorrect control appearance, for example, missing SVG icons.

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 the Razor syntax.

See Using Extensions in Razor Views to learn more.

See Also