Class ScriptTagHelper<TOptions>
- Namespace
- Cuemon.AspNetCore.Razor.TagHelpers
- Assembly
- Cuemon.AspNetCore.Razor.TagHelpers.dll
Provides a base-class for targeting <script> elements that supports ICacheBusting versioning.
public abstract class ScriptTagHelper<TOptions> : CacheBustingTagHelper<TOptions>, ITagHelper, ITagHelperComponent, IConfigurable<TOptions> where TOptions : TagHelperOptions, new()
Type Parameters
TOptions
- Inheritance
-
CacheBustingTagHelper<TOptions>ScriptTagHelper<TOptions>
- Implements
-
IConfigurable<TOptions>
- Derived
- Inherited Members
Constructors
ScriptTagHelper(IOptions<TOptions>, ICacheBusting)
Initializes a new instance of the ScriptTagHelper<TOptions> class.
protected ScriptTagHelper(IOptions<TOptions> setup, ICacheBusting cacheBusting = null)
Parameters
setupIOptions<TOptions>The
TOptionswhich need to be configured.cacheBustingICacheBustingAn optional object implementing the ICacheBusting interface.
Properties
Defer
Gets or sets a value indicating whether the script is executed when the page has finished parsing.
public bool Defer { get; set; }
Property Value
- bool
trueif the script is executed when the page has finished parsing; otherwise,false.
Src
Gets or sets the source of the script.
public string Src { get; set; }
Property Value
- string
The source of the script.
Methods
ProcessAsync(TagHelperContext, TagHelperOutput)
Asynchronously executes the TagHelper with the given context and output.
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters
contextTagHelperContextContains information associated with the current HTML tag.
outputTagHelperOutputA stateful HTML element used to generate an HTML tag.
Returns
See Also
CacheBustingTagHelper<TOptions>