ScriptTagHelper Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
ITagHelper implementation targeting <script> elements that supports fallback src paths.
public ref class ScriptTagHelper : Microsoft::AspNetCore::Mvc::Razor::TagHelpers::UrlResolutionTagHelper
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-src-include")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-src-exclude")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src-include")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src-exclude")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-test")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-append-version")]
public class ScriptTagHelper : Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-src-include")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-src-exclude")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src-include")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src-exclude")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-test")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-append-version")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="type")]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-importmap")]
public class ScriptTagHelper : Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-src-include")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-src-exclude")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src-include")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src-exclude")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-test")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-append-version")>]
type ScriptTagHelper = class
inherit UrlResolutionTagHelper
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-src-include")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-src-exclude")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src-include")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-src-exclude")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-fallback-test")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-append-version")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="type")>]
[<Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("script", Attributes="asp-importmap")>]
type ScriptTagHelper = class
inherit UrlResolutionTagHelper
Public Class ScriptTagHelper
Inherits UrlResolutionTagHelper
- Inheritance
- Attributes
Remarks
The tag helper won't process for cases with just the 'src' attribute.
Constructors
Properties
AppendVersion |
Value indicating if file version should be appended to src urls. |
Cache |
Gets the IMemoryCache used to store globbed urls. |
FallbackSrc |
The URL of a Script tag to fallback to in the case the primary one fails. |
FallbackSrcExclude |
A comma separated list of globbed file patterns of JavaScript scripts to exclude from the fallback list, in the case the primary one fails. The glob patterns are assessed relative to the application's 'webroot' setting. Must be used in conjunction with FallbackSrcInclude. |
FallbackSrcInclude |
A comma separated list of globbed file patterns of JavaScript scripts to fallback to in the case the primary one fails. The glob patterns are assessed relative to the application's 'webroot' setting. |
FallbackTestExpression |
The script method defined in the primary script to use for the fallback test. |
GlobbingUrlBuilder |
Gets the GlobbingUrlBuilder used to populate included and excluded urls. |
HostingEnvironment |
Gets the IWebHostEnvironment for the application. |
HtmlEncoder |
The HtmlEncoder. (Inherited from UrlResolutionTagHelper) |
ImportMap |
The ImportMapDefinition to use for the document. |
JavaScriptEncoder |
Gets the JavaScriptEncoder used to encode fallback information. |
Order |
When a set of ITagHelpers are executed, their Init(TagHelperContext)'s are first invoked in the specified Order; then their ProcessAsync(TagHelperContext, TagHelperOutput)'s are invoked in the specified Order. Lower values are executed first. |
Src |
Address of the external script to use. |
SrcExclude |
A comma separated list of globbed file patterns of JavaScript scripts to exclude from loading. The glob patterns are assessed relative to the application's 'webroot' setting. Must be used in conjunction with SrcInclude. |
SrcInclude |
A comma separated list of globbed file patterns of JavaScript scripts to load. The glob patterns are assessed relative to the application's 'webroot' setting. |
SuppressFallbackIntegrity |
Boolean value that determines if an integrity hash will be compared with FallbackSrc value. |
Type |
Type of the script. |
UrlHelperFactory |
The IUrlHelperFactory. (Inherited from UrlResolutionTagHelper) |
ViewContext |
The ViewContext. (Inherited from UrlResolutionTagHelper) |
Methods
Init(TagHelperContext) |
Initializes the ITagHelper with the given |
Process(TagHelperContext, TagHelperOutput) |
Synchronously executes the TagHelper with the given |
ProcessAsync(TagHelperContext, TagHelperOutput) |
Asynchronously executes the TagHelper with the given |
ProcessUrlAttribute(String, TagHelperOutput) |
Resolves and updates URL values starting with '~/' (relative to the application's 'webroot' setting) for
|
TryResolveUrl(String, IHtmlContent) |
Tries to resolve the given |
TryResolveUrl(String, String) |
Tries to resolve the given |