LinkTagHelper 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 <link> elements that supports fallback href paths.
public ref class LinkTagHelper : Microsoft::AspNetCore::Mvc::Razor::TagHelpers::UrlResolutionTagHelper
[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
[<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)>]
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
Properties
AppendVersion |
Value indicating if file version should be appended to the href urls. |
Cache |
Gets the IMemoryCache used to store globbed urls. |
FallbackHref |
The URL of a CSS stylesheet to fallback to in the case the primary one fails. |
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 |
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 |
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 |
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 |
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 |
Gets the GlobbingUrlBuilder used to populate included and excluded urls. |
HostingEnvironment |
Gets the IWebHostEnvironment for the application. |
Href |
Address of the linked resource. |
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 |
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 |
The HtmlEncoder. (Inherited from UrlResolutionTagHelper) |
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. |
SuppressFallbackIntegrity |
Boolean value that determines if an integrity hash will be compared with FallbackHref value. |
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 |
Applies to
Feedback
Submit and view feedback for