Skip to content

LayoutScriptBundleScript class

namespace: Serenity.Web   assembly: Serenity.Net.Web

A predefined dynamic script bundle that concatenates the layout JS files declared with LayoutScriptFileAttribute. It is registered under ScriptName at startup, so it can be referenced from a bundle definition (e.g. dynamic://Bundle.LayoutScriptFiles) or rendered with @Html.Script("dynamic://Bundle.LayoutScriptFiles").

public class LayoutScriptBundleScript : DynamicScript
parameter description
fileProvider The layout script file provider.
bundleBuilder The script bundle builder.

Public Members

name description
LayoutScriptBundleScript(…) A predefined dynamic script bundle that concatenates the layout JS files declared with LayoutScriptFileAttribute. It is registered under ScriptName at startup, so it can be referenced from a bundle definition (e.g. dynamic://Bundle.LayoutScriptFiles) or rendered with @Html.Script("dynamic://Bundle.LayoutScriptFiles").
override GetScript()
const ScriptName The predefined registration name of the layout script bundle.

Exceptions

exception condition
ArgumentNullException One of the arguments is null.

Remarks

Unlike Html.LayoutScriptFiles(), the file set is resolved by GetFiles the first time the script is generated and then cached, so it does not change dynamically when feature toggles change at runtime. Use Html.LayoutScriptFiles() when the file set should follow feature toggles per request. Initializes a new instance of the LayoutScriptBundleScript class.

See Also