LinkTagHelper LinkTagHelper LinkTagHelper Class

Definition

ITagHelper implementation targeting <link> elements that supports fallback href paths.

[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="asp-href-include", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="asp-href-exclude", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="asp-fallback-href", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="asp-fallback-href-include", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="asp-fallback-href-exclude", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="asp-fallback-test-class", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="asp-fallback-test-property", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="asp-fallback-test-value", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
[Microsoft.AspNetCore.Razor.TagHelpers.HtmlTargetElement("link", Attributes="asp-append-version", TagStructure=Microsoft.AspNetCore.Razor.TagHelpers.TagStructure.WithoutEndTag)]
public class LinkTagHelper : Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper
type LinkTagHelper = class
    inherit UrlResolutionTagHelper
Public Class LinkTagHelper
Inherits UrlResolutionTagHelper
Inheritance
Attributes

Remarks

The tag helper won't process for cases with just the 'href' attribute.

Constructors

LinkTagHelper(IHostingEnvironment, IMemoryCache, HtmlEncoder, JavaScriptEncoder, IUrlHelperFactory) LinkTagHelper(IHostingEnvironment, IMemoryCache, HtmlEncoder, JavaScriptEncoder, IUrlHelperFactory) LinkTagHelper(IHostingEnvironment, IMemoryCache, HtmlEncoder, JavaScriptEncoder, IUrlHelperFactory)

Creates a new LinkTagHelper.

LinkTagHelper(IHostingEnvironment, TagHelperMemoryCacheProvider, IFileVersionProvider, HtmlEncoder, JavaScriptEncoder, IUrlHelperFactory) LinkTagHelper(IHostingEnvironment, TagHelperMemoryCacheProvider, IFileVersionProvider, HtmlEncoder, JavaScriptEncoder, IUrlHelperFactory) LinkTagHelper(IHostingEnvironment, TagHelperMemoryCacheProvider, IFileVersionProvider, HtmlEncoder, JavaScriptEncoder, IUrlHelperFactory)

Creates a new LinkTagHelper.

Properties

AppendVersion AppendVersion AppendVersion

Value indicating if file version should be appended to the href urls.

Cache Cache Cache
FallbackHref FallbackHref FallbackHref

The URL of a CSS stylesheet to fallback to in the case the primary one fails.

FallbackHrefExclude FallbackHrefExclude FallbackHrefExclude

A comma separated list of globbed file patterns of CSS stylesheets 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 FallbackHrefInclude.

FallbackHrefInclude FallbackHrefInclude FallbackHrefInclude

A comma separated list of globbed file patterns of CSS stylesheets to fallback to in the case the primary one fails. The glob patterns are assessed relative to the application's 'webroot' setting.

FallbackTestClass FallbackTestClass FallbackTestClass

The class name defined in the stylesheet to use for the fallback test. Must be used in conjunction with FallbackTestProperty and FallbackTestValue, and either FallbackHref or FallbackHrefInclude.

FallbackTestProperty FallbackTestProperty FallbackTestProperty

The CSS property name to use for the fallback test. Must be used in conjunction with FallbackTestClass and FallbackTestValue, and either FallbackHref or FallbackHrefInclude.

FallbackTestValue FallbackTestValue FallbackTestValue

The CSS property value to use for the fallback test. Must be used in conjunction with FallbackTestClass and FallbackTestProperty, and either FallbackHref or FallbackHrefInclude.

GlobbingUrlBuilder GlobbingUrlBuilder GlobbingUrlBuilder
HostingEnvironment HostingEnvironment HostingEnvironment
Href Href Href

Address of the linked resource.

HrefExclude HrefExclude HrefExclude

A comma separated list of globbed file patterns of CSS stylesheets to exclude from loading. The glob patterns are assessed relative to the application's 'webroot' setting. Must be used in conjunction with HrefInclude.

HrefInclude HrefInclude HrefInclude

A comma separated list of globbed file patterns of CSS stylesheets to load. The glob patterns are assessed relative to the application's 'webroot' setting.

HtmlEncoder HtmlEncoder HtmlEncoder Inherited from UrlResolutionTagHelper
JavaScriptEncoder JavaScriptEncoder JavaScriptEncoder
Order Order Order
SuppressFallbackIntegrity SuppressFallbackIntegrity SuppressFallbackIntegrity

Boolean value that determines if an integrity hash will be compared with FallbackHref value.

UrlHelperFactory UrlHelperFactory UrlHelperFactory Inherited from UrlResolutionTagHelper
ViewContext ViewContext ViewContext Inherited from UrlResolutionTagHelper

Methods

Init(TagHelperContext) Init(TagHelperContext) Init(TagHelperContext)

Initializes the ITagHelper with the given context. Additions to Items should be done within this method to ensure they're added prior to executing the children.

(Inherited from TagHelper)
Process(TagHelperContext, TagHelperOutput) Process(TagHelperContext, TagHelperOutput) Process(TagHelperContext, TagHelperOutput)
ProcessAsync(TagHelperContext, TagHelperOutput) ProcessAsync(TagHelperContext, TagHelperOutput) ProcessAsync(TagHelperContext, TagHelperOutput)

Asynchronously executes the TagHelper with the given context and output.

(Inherited from TagHelper)
ProcessUrlAttribute(String, TagHelperOutput) ProcessUrlAttribute(String, TagHelperOutput) ProcessUrlAttribute(String, TagHelperOutput)

Resolves and updates URL values starting with '~/' (relative to the application's 'webroot' setting) for output's Attributes whose Name is attributeName.

(Inherited from UrlResolutionTagHelper)
TryResolveUrl(String, IHtmlContent) TryResolveUrl(String, IHtmlContent) TryResolveUrl(String, IHtmlContent)

Tries to resolve the given url value relative to the application's 'webroot' setting.

(Inherited from UrlResolutionTagHelper)
TryResolveUrl(String, String) TryResolveUrl(String, String) TryResolveUrl(String, String)

Tries to resolve the given url value relative to the application's 'webroot' setting.

(Inherited from UrlResolutionTagHelper)

Applies to