aspnetmvc-devexpress-dot-web-dot-mvc-dot-ui-dot-extensionsfactory-dot-getscripts-x28-devexpress-dot-web-dot-mvc-dot-ui-dot-script-x29.md
Returns the HTML code representing the rendering of the specified scripts.
Namespace : DevExpress.Web.Mvc.UI
Assembly : DevExpress.Web.Mvc5.v25.2.dll
NuGet Package : DevExpress.Web.Mvc5
public MvcHtmlString GetScripts(
params Script[] scriptItems
)
Public Function GetScripts(
ParamArray scriptItems As Script()
) As MvcHtmlString
| Name | Type | Description |
|---|---|---|
| scriptItems | Script[] |
An array of Script objects defining the attached scripts.
|
| Type | Description |
|---|---|
| MvcHtmlString |
A MvcHtmlString object representing the HTML-encoded string.
|
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.
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