Nucleus .Net Core CMS

HtmlHelpers.AddStyleHtmlHelper Class

Namespace: Nucleus.ViewFeatures.HtmlHelpers
Assembly: Nucleus.ViewFeatures.dll
Html helper used to add styles.
AddStyle (IHtmlHelper htmlHelper, WellKnownScripts script)
Add a well-known script.
AddStyle (ViewContext context, WellKnownScripts script)
Add a well-known script.
AddStyle (IHtmlHelper htmlHelper, String stylesheetPath)
Register the specified style to be added to the Layout or module's CSS styles.
Parameters
Name Type
htmlHelper Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
stylesheetPath String
Examples
@Html.AddScript("~#/MyModule.css")
Remarks
Extensions (modules) can use this Html Helper to add CSS stylesheets to the HEAD block. The scriptPath can contain the ~! for the currently executing view path, or ~# for the currently executing extension.
AddStyle (IHtmlHelper htmlHelper, String stylesheetPath, Int32 sortIndex)
Register the specified style to be added to the Layout or module's CSS styles.
Parameters
Name Type
htmlHelper Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
stylesheetPath String
sortIndex Int32
Remarks
Extensions (modules) can use this Html Helper to add CSS stylesheets to the HEAD block. The scriptPath can contain ~! for the currently executing view path, or ~# for the currently executing extension.
AddStyle (IHtmlHelper htmlHelper, String stylesheetPath, Boolean defer)
Register the specified style to be added to the Layout or module's CSS styles.
Parameters
Name Type
htmlHelper Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
stylesheetPath String
defer Boolean
Examples
@Html.AddScript(~#/MyModule.css)
Remarks
Extensions (modules) can use this Html Helper to add CSS stylesheets to the HEAD block. The scriptPath can contain the ~! for the currently executing view path, or ~# for the currently executing extension.
AddStyle (IHtmlHelper htmlHelper, String stylesheetPath, Boolean defer, Boolean isDynamic)
Register the specified style to be added to the Layout or module's CSS styles.
Parameters
Name Type
htmlHelper Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
stylesheetPath String
defer Boolean
isDynamic Boolean
Examples
@Html.AddScript(~#/MyModule.css)
Remarks
Extensions (modules) can use this Html Helper to add CSS stylesheets to the HEAD block. The scriptPath can contain ~! for the currently executing view path, or ~# for the currently executing extension.
AddStyle (IHtmlHelper htmlHelper, String stylesheetPath, Boolean defer, Boolean isDynamic, String version, Int32 sortIndex)
Register the specified style to be added to the Layout or module's CSS styles.
Parameters
Name Type
htmlHelper Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper
stylesheetPath String
defer Boolean
isDynamic Boolean
version String
sortIndex Int32
Examples
@Html.AddScript(~#/MyModule.css)
Remarks
Extensions (modules) can use this Html Helper to add CSS stylesheets to the HEAD block. The scriptPath can contain the ~! for the currently executing view path, or ~# for the currently executing extension.
AddStyle (ViewContext context, String stylesheetPath, Boolean defer, Boolean isDynamic, String version, Int32 sortIndex)
Register the specified style to be added to the Layout or module's CSS styles.
Parameters
Name Type
context Microsoft.AspNetCore.Mvc.Rendering.ViewContext
stylesheetPath String
defer Boolean
isDynamic Boolean
version String
sortIndex Int32
Examples
@Html.AddScript(~#/MyModule.css)
Remarks
Extensions (modules) can use this Html Helper to add CSS stylesheets to the HEAD block. The scriptPath can contain the ~! for the currently executing view path, or ~# for the currently executing extension.
RenderStyles (IHtmlHelper htmlHelper)
Adds the scripts submitted by AddStyle to the layout. This method is intended for use by the Nucleus Core layout.
Parameters
Name Type
htmlHelper Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper