LayoutCssBundleScript constructor
A predefined dynamic CSS bundle that concatenates the layout CSS files declared with LayoutCssFileAttribute. It is registered under ScriptName at startup, so it can be referenced from a bundle definition (e.g. dynamic://CssBundle.LayoutCssFiles) or rendered with @Html.Stylesheet("dynamic://CssBundle.LayoutCssFiles").
public LayoutCssBundleScript(ILayoutCssFileProvider fileProvider, ICssBundleBuilder bundleBuilder)
| parameter | description |
|---|---|
| fileProvider | The layout CSS file provider. |
| bundleBuilder | The CSS bundle builder. |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | One of the arguments is null. |
Remarks
Unlike Html.LayoutCssFiles(), 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.LayoutCssFiles() when the file set should follow feature toggles per request. Initializes a new instance of the LayoutCssBundleScript class.
See Also
- interface ILayoutCssFileProvider
- interface ICssBundleBuilder
- class LayoutCssBundleScript