Skip to main content

ExtensionsFactory.GetScripts(Script[]) Method

Returns the HTML code representing the rendering of the specified scripts.

Namespace: DevExpress.Web.Mvc.UI

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

Declaration

public MvcHtmlString GetScripts(
    params Script[] scriptItems
)

Parameters

Name Type Description
scriptItems Script[]

An array of Script objects defining the attached scripts.

Returns

Type Description
MvcHtmlString

A MvcHtmlString object representing the HTML-encoded string.

Remarks

Use the GetScripts method to attach the scripts required for the DevExpress ASP.NET MVC extensions.

If the resources section of an application’s Web.config file contains a reference to the ThirdParty and/or DevExtreme libraries, the GetScripts method will attach the corresponding libraries and additional resources to the View.

<devExpress>
    <!-- ... -->
    <resources>
        <add type="ThirdParty" />
        <add type="DevExtreme" />
    </resources>
</devExpress>

For more information about this configuration option and a complete list of the scripts attached to each extension suite, see External Client Libraries.

Example

The following example demonstrates how to attach the DevExpress MVC Extensions’ scripts to the View.

<head>
    ...
    @Html.DevExpress().GetScripts( 
        new Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout }, 
        new Script { ExtensionSuite = ExtensionSuite.HtmlEditor }, 
        new Script { ExtensionSuite = ExtensionSuite.GridView }, 
        new Script { ExtensionSuite = ExtensionSuite.PivotGrid },
        new Script { ExtensionSuite = ExtensionSuite.Editors }, 
        new Script { ExtensionSuite = ExtensionSuite.Chart },
        new Script { ExtensionSuite = ExtensionSuite.Report },
        new Script { ExtensionSuite = ExtensionSuite.Scheduler },
        new Script { ExtensionSuite = ExtensionSuite.TreeList }
    )
    ...
</head>
See Also