Table of Contents

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
Provides a base-class for targeting <script> elements that supports versioning.
Inheritance
Object
TagHelper
ScriptTagHelper<TOptions>
Implements
ITagHelper
ITagHelperComponent
IConfigurable<TOptions>
Derived
Inherited Members
TagHelper.Init(TagHelperContext)
TagHelper.Process(TagHelperContext, TagHelperOutput)
TagHelper.Order

Constructors

ScriptTagHelper(IOptions<TOptions>, ICacheBusting)

Initializes a new instance of the ScriptTagHelper<TOptions> class.

protected ScriptTagHelper(IOptions<TOptions> setup, ICacheBusting cacheBusting = null)

Parameters

setup IOptions<TOptions>

The TOptions which need to be configured.

cacheBusting ICacheBusting

An 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

Boolean

true if 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 Microsoft.AspNetCore.Razor.TagHelpers.TagHelper with the given context and output.

public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)

Parameters

context TagHelperContext

Contains information associated with the current HTML tag.

output TagHelperOutput

A stateful HTML element used to generate an HTML tag.

Returns

Task

A System.Threading.Tasks.Task that on completion updates the output.

See Also